Browse Source

TxBuilder: vout is actually vin for addInput

hk-custom-address
Daniel Cousens 10 years ago
parent
commit
986e9d4710
  1. 9
      src/transaction_builder.js

9
src/transaction_builder.js

@ -186,12 +186,11 @@ TransactionBuilder.prototype.addInput = function(prevTx, index, sequence, prevOu
var prevOut = prevOutHash.toString('hex') + ':' + index var prevOut = prevOutHash.toString('hex') + ':' + index
assert(!(prevOut in this.prevTxMap), 'Transaction is already an input') 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 return vin
this.inputs[vout] = input
return vout
} }
TransactionBuilder.prototype.addOutput = function(scriptPubKey, value) { TransactionBuilder.prototype.addOutput = function(scriptPubKey, value) {

Loading…
Cancel
Save