Skip to content

Commit 105a827

Browse files
Thomas Kerindcousens
authored andcommitted
buildstack - don't return op_0
1 parent 7563d8f commit 105a827

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/transaction_builder.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -389,14 +389,14 @@ function buildStack (type, signatures, pubKeys, allowIncomplete) {
389389
} else if (type === scriptTypes.MULTISIG) {
390390
if (signatures.length > 0) {
391391
signatures = signatures.map(function (signature) {
392-
return signature || ops.OP_0
392+
return signature || Buffer.from('', 'hex')
393393
})
394394
if (!allowIncomplete) {
395395
// remove blank signatures
396-
signatures = signatures.filter(function (x) { return x !== ops.OP_0 })
396+
signatures = signatures.filter(function (x) { return x.length !== 0 })
397397
}
398398

399-
return bscript.multisig.input.encodeStack(signatures /* see if it's necessary first */)
399+
return [].concat(Buffer.from('', 'hex'), signatures)
400400
}
401401
} else {
402402
throw new Error('Not yet supported')
@@ -463,7 +463,7 @@ function buildInput (input, allowIncomplete) {
463463
return {
464464
type: scriptType,
465465
script: bscript.compile(sig),
466-
witness: bscript.toStack(witness)
466+
witness: witness
467467
}
468468
}
469469

0 commit comments

Comments
 (0)