transaction_builder: keep a mapping from prevTxOut to vin
This commit is contained in:
parent
d1dc0840b5
commit
5824a84fd5
1 changed files with 2 additions and 2 deletions
|
@ -323,7 +323,7 @@ TransactionBuilder.prototype.__addInputUnsafe = function (txHash, vout, options)
|
|||
}
|
||||
|
||||
var prevTxOut = txHash.toString('hex') + ':' + vout
|
||||
if (this.prevTxMap[prevTxOut]) throw new Error('Duplicate TxOut: ' + prevTxOut)
|
||||
if (this.prevTxMap[prevTxOut] !== undefined) throw new Error('Duplicate TxOut: ' + prevTxOut)
|
||||
|
||||
var input = {}
|
||||
|
||||
|
@ -358,7 +358,7 @@ TransactionBuilder.prototype.__addInputUnsafe = function (txHash, vout, options)
|
|||
|
||||
var vin = this.tx.addInput(txHash, vout, options.sequence, options.scriptSig)
|
||||
this.inputs[vin] = input
|
||||
this.prevTxMap[prevTxOut] = true
|
||||
this.prevTxMap[prevTxOut] = vin
|
||||
|
||||
return vin
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue