TxBuilder: fix OP_0 in buildComplete
This commit is contained in:
parent
c79fecffa3
commit
bcf8d0177d
1 changed files with 8 additions and 3 deletions
|
@ -242,11 +242,16 @@ TransactionBuilder.prototype.__build = function (allowIncomplete) {
|
||||||
})
|
})
|
||||||
|
|
||||||
// fill in blanks with OP_0
|
// fill in blanks with OP_0
|
||||||
|
if (allowIncomplete) {
|
||||||
for (var i = 0; i < msSignatures.length; ++i) {
|
for (var i = 0; i < msSignatures.length; ++i) {
|
||||||
if (msSignatures[i]) continue
|
if (msSignatures[i]) continue
|
||||||
|
|
||||||
msSignatures[i] = ops.OP_0
|
msSignatures[i] = ops.OP_0
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
// Array.prototype.filter returns non-sparse array
|
||||||
|
msSignatures = msSignatures.filter(function (x) { return x })
|
||||||
|
}
|
||||||
|
|
||||||
var redeemScript = allowIncomplete ? undefined : input.redeemScript
|
var redeemScript = allowIncomplete ? undefined : input.redeemScript
|
||||||
scriptSig = scripts.multisigInput(msSignatures, redeemScript)
|
scriptSig = scripts.multisigInput(msSignatures, redeemScript)
|
||||||
|
|
Loading…
Add table
Reference in a new issue