TxBuilder: fix OP_0 in buildComplete

This commit is contained in:
Daniel Cousens 2015-03-03 09:55:17 +11:00
parent c79fecffa3
commit bcf8d0177d

View file

@ -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)