TxBuilder: fix invalid txin.index usage for non-zero vin inputs
This commit is contained in:
parent
1c744cfa5a
commit
e2357c09ce
1 changed files with 2 additions and 2 deletions
|
@ -30,7 +30,7 @@ TransactionBuilder.fromTransaction = function(transaction) {
|
||||||
})
|
})
|
||||||
|
|
||||||
// Extract/add signatures
|
// Extract/add signatures
|
||||||
transaction.ins.forEach(function(txin) {
|
transaction.ins.forEach(function(txin, i) {
|
||||||
// Ignore empty scripts
|
// Ignore empty scripts
|
||||||
if (txin.script.buffer.length === 0) return
|
if (txin.script.buffer.length === 0) return
|
||||||
|
|
||||||
|
@ -86,7 +86,7 @@ TransactionBuilder.fromTransaction = function(transaction) {
|
||||||
assert(false, scriptType + ' not supported')
|
assert(false, scriptType + ' not supported')
|
||||||
}
|
}
|
||||||
|
|
||||||
txb.signatures[txin.index] = {
|
txb.signatures[i] = {
|
||||||
hashType: hashType,
|
hashType: hashType,
|
||||||
pubKeys: pubKeys,
|
pubKeys: pubKeys,
|
||||||
redeemScript: redeemScript,
|
redeemScript: redeemScript,
|
||||||
|
|
Loading…
Reference in a new issue