script: enforce PUSH_DATA codes for witness outputs

This commit is contained in:
Daniel Cousens 2016-07-12 11:42:01 +10:00
parent 20a026aefe
commit 9f1d41fc44

View file

@ -210,14 +210,16 @@ function isWitnessPubKeyHashOutput (script) {
var buffer = compile(script)
return buffer.length === 22 &&
buffer[0] === OPS.OP_0
buffer[0] === OPS.OP_0 &&
buffer[1] === 0x14
}
function isWitnessScriptHashOutput (script) {
var buffer = compile(script)
return buffer.length === 34 &&
buffer[0] === OPS.OP_0
buffer[0] === OPS.OP_0 &&
buffer[1] === 0x20
}
// allowIncomplete is to account for combining signatures