txbuilder: fix canSign returning true for missing witness value
This commit is contained in:
parent
7795ffd328
commit
eb6eac67b0
1 changed files with 4 additions and 1 deletions
|
@ -663,7 +663,10 @@ function canSign (input) {
|
|||
input.signatures !== undefined &&
|
||||
input.signatures.length === input.pubKeys.length &&
|
||||
input.pubKeys.length > 0 &&
|
||||
input.witness !== undefined
|
||||
(
|
||||
input.witness === false ||
|
||||
(input.witness === true && input.value !== undefined)
|
||||
)
|
||||
}
|
||||
|
||||
TransactionBuilder.prototype.sign = function (vin, keyPair, redeemScript, hashType, witnessValue, witnessScript) {
|
||||
|
|
Loading…
Reference in a new issue