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,10 +242,15 @@ TransactionBuilder.prototype.__build = function (allowIncomplete) {
}) })
// fill in blanks with OP_0 // fill in blanks with OP_0
for (var i = 0; i < msSignatures.length; ++i) { if (allowIncomplete) {
if (msSignatures[i]) continue for (var i = 0; i < msSignatures.length; ++i) {
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