fix isMultisigOutput
This commit is contained in:
parent
85a399d46b
commit
eae8bcf676
2 changed files with 5 additions and 3 deletions
src
|
@ -225,12 +225,10 @@ function isMultisigOutput (script) {
|
|||
if (chunks[chunks.length - 1] !== OPS.OP_CHECKMULTISIG) return false
|
||||
|
||||
var mOp = chunks[0]
|
||||
if (mOp === OPS.OP_0) return false
|
||||
if (mOp < OPS.OP_1) return false
|
||||
if (mOp > OPS.OP_16) return false
|
||||
|
||||
var nOp = chunks[chunks.length - 2]
|
||||
if (nOp === OPS.OP_0) return false
|
||||
if (nOp < OPS.OP_1) return false
|
||||
if (nOp > OPS.OP_16) return false
|
||||
|
||||
|
@ -239,7 +237,7 @@ function isMultisigOutput (script) {
|
|||
if (n < m) return false
|
||||
|
||||
var pubKeys = chunks.slice(1, -2)
|
||||
if (n < pubKeys.length) return false
|
||||
if (n !== pubKeys.length) return false
|
||||
|
||||
return pubKeys.every(isCanonicalPubKey)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue