Merge pull request #908 from bitcoinjs/txbfix
TxBuilder: fix canSign returning true for missing witness value
This commit is contained in:
commit
b6a6b0a50a
1 changed files with 4 additions and 1 deletions
|
@ -663,7 +663,10 @@ function canSign (input) {
|
||||||
input.signatures !== undefined &&
|
input.signatures !== undefined &&
|
||||||
input.signatures.length === input.pubKeys.length &&
|
input.signatures.length === input.pubKeys.length &&
|
||||||
input.pubKeys.length > 0 &&
|
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) {
|
TransactionBuilder.prototype.sign = function (vin, keyPair, redeemScript, hashType, witnessValue, witnessScript) {
|
||||||
|
|
Loading…
Reference in a new issue