TxBuilder: add sequence number passthrough

This commit is contained in:
Daniel Cousens 2014-07-25 18:30:39 +10:00
parent f3199b6fce
commit 7f62069d82

View file

@ -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