Browse Source

TxBuilder: add sequence number passthrough

hk-custom-address
Daniel Cousens 11 years ago
parent
commit
7f62069d82
  1. 4
      src/transaction_builder.js

4
src/transaction_builder.js

@ -14,7 +14,7 @@ function TransactionBuilder() {
this.tx = new Transaction() this.tx = new Transaction()
} }
TransactionBuilder.prototype.addInput = function(prevTx, index, prevOutScript) { TransactionBuilder.prototype.addInput = function(prevTx, index, prevOutScript, sequence) {
var prevOutHash var prevOutHash
if (typeof prevTx === 'string') { if (typeof prevTx === 'string') {
@ -46,7 +46,7 @@ TransactionBuilder.prototype.addInput = function(prevTx, index, prevOutScript) {
var prevOut = prevOutHash.toString('hex') + ':' + index var prevOut = prevOutHash.toString('hex') + ':' + index
assert(!(prevOut in this.prevOutMap), 'Transaction is already an input') assert(!(prevOut in this.prevOutMap), 'Transaction is already an input')
var vout = this.tx.addInput(prevOutHash, index) var vout = this.tx.addInput(prevOutHash, index, sequence)
this.prevOutMap[prevOut] = true this.prevOutMap[prevOut] = true
this.prevOutScripts[vout] = prevOutScript this.prevOutScripts[vout] = prevOutScript
this.prevOutTypes[vout] = prevOutType this.prevOutTypes[vout] = prevOutType

Loading…
Cancel
Save