TransactionBuilder: reword error for correctness
This commit is contained in:
parent
96f55a2ca4
commit
49c6ebe3a0
1 changed files with 3 additions and 3 deletions
|
@ -249,12 +249,12 @@ TransactionBuilder.prototype.addInput = function (txHash, vout, sequence, prevOu
|
||||||
throw new Error('No, this would invalidate signatures')
|
throw new Error('No, this would invalidate signatures')
|
||||||
}
|
}
|
||||||
|
|
||||||
var prevOut = txHash.toString('hex') + ':' + vout
|
var prevTxOut = txHash.toString('hex') + ':' + vout
|
||||||
if (this.prevTxMap[prevOut]) throw new Error('Transaction is already an input')
|
if (this.prevTxMap[prevTxOut]) throw new Error('Duplicate TxOut: ' + prevTxOut)
|
||||||
|
|
||||||
var vin = this.tx.addInput(txHash, vout, sequence)
|
var vin = this.tx.addInput(txHash, vout, sequence)
|
||||||
this.inputs[vin] = input
|
this.inputs[vin] = input
|
||||||
this.prevTxMap[prevOut] = vin
|
this.prevTxMap[prevTxOut] = vin
|
||||||
|
|
||||||
return vin
|
return vin
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue