From 986e9d4710af0ead46fc3324eae82c85e404ef40 Mon Sep 17 00:00:00 2001 From: Daniel Cousens Date: Thu, 5 Feb 2015 13:29:59 +1100 Subject: [PATCH] TxBuilder: vout is actually vin for addInput --- src/transaction_builder.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/transaction_builder.js b/src/transaction_builder.js index 5f6571f..d33bf71 100644 --- a/src/transaction_builder.js +++ b/src/transaction_builder.js @@ -186,12 +186,11 @@ TransactionBuilder.prototype.addInput = function(prevTx, index, sequence, prevOu var prevOut = prevOutHash.toString('hex') + ':' + index assert(!(prevOut in this.prevTxMap), 'Transaction is already an input') - var vout = this.tx.addInput(prevOutHash, index, sequence) + var vin = this.tx.addInput(prevOutHash, index, sequence) + this.inputs[vin] = input + this.prevTxMap[prevOut] = vin - this.prevTxMap[prevOut] = true - this.inputs[vout] = input - - return vout + return vin } TransactionBuilder.prototype.addOutput = function(scriptPubKey, value) {