From 49c6ebe3a0a0b0407c2cb8105e00d36bd695fddc Mon Sep 17 00:00:00 2001 From: Daniel Cousens Date: Tue, 27 Sep 2016 15:10:38 +1000 Subject: [PATCH] TransactionBuilder: reword error for correctness --- src/transaction_builder.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/transaction_builder.js b/src/transaction_builder.js index 9a3c566..37f7b6f 100644 --- a/src/transaction_builder.js +++ b/src/transaction_builder.js @@ -249,12 +249,12 @@ TransactionBuilder.prototype.addInput = function (txHash, vout, sequence, prevOu throw new Error('No, this would invalidate signatures') } - var prevOut = txHash.toString('hex') + ':' + vout - if (this.prevTxMap[prevOut]) throw new Error('Transaction is already an input') + var prevTxOut = txHash.toString('hex') + ':' + vout + if (this.prevTxMap[prevTxOut]) throw new Error('Duplicate TxOut: ' + prevTxOut) var vin = this.tx.addInput(txHash, vout, sequence) this.inputs[vin] = input - this.prevTxMap[prevOut] = vin + this.prevTxMap[prevTxOut] = vin return vin }