From e2357c09ce74f30676e129e15ef16adbfe0493c1 Mon Sep 17 00:00:00 2001 From: Daniel Cousens Date: Sat, 30 Aug 2014 12:10:02 +1000 Subject: [PATCH] TxBuilder: fix invalid txin.index usage for non-zero vin inputs --- src/transaction_builder.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/transaction_builder.js b/src/transaction_builder.js index 05c0591..c4f18da 100644 --- a/src/transaction_builder.js +++ b/src/transaction_builder.js @@ -30,7 +30,7 @@ TransactionBuilder.fromTransaction = function(transaction) { }) // Extract/add signatures - transaction.ins.forEach(function(txin) { + transaction.ins.forEach(function(txin, i) { // Ignore empty scripts if (txin.script.buffer.length === 0) return @@ -86,7 +86,7 @@ TransactionBuilder.fromTransaction = function(transaction) { assert(false, scriptType + ' not supported') } - txb.signatures[txin.index] = { + txb.signatures[i] = { hashType: hashType, pubKeys: pubKeys, redeemScript: redeemScript,