Merge pull request #251 from olalonde/tx-sequence

TxIn: add sequence to standardized object
This commit is contained in:
Ryan X. Charles 2014-04-11 13:37:39 -03:00
commit 5815aac9cb
1 changed files with 4 additions and 1 deletions

View File

@ -40,6 +40,8 @@ function TransactionIn(data) {
this.q = data.q ? data.q : data.sequence; this.q = data.q ? data.q : data.sequence;
} }
TransactionIn.MAX_SEQUENCE = 0xffffffff;
TransactionIn.prototype.getScript = function getScript() { TransactionIn.prototype.getScript = function getScript() {
return new Script(this.s); return new Script(this.s);
}; };
@ -447,7 +449,8 @@ Transaction.prototype.getStandardizedObject = function getStandardizedObject() {
prev_out: { prev_out: {
hash: buffertools.reverse(new Buffer(txin.getOutpointHash())).toString('hex'), hash: buffertools.reverse(new Buffer(txin.getOutpointHash())).toString('hex'),
n: txin.getOutpointIndex() n: txin.getOutpointIndex()
} },
sequence: txin.q
}; };
if (txin.isCoinBase()) { if (txin.isCoinBase()) {
txinObj.coinbase = txin.s.toString('hex'); txinObj.coinbase = txin.s.toString('hex');