Browse Source

Merge pull request #251 from olalonde/tx-sequence

TxIn: add sequence to standardized object
patch-2
Ryan X. Charles 11 years ago
parent
commit
5815aac9cb
  1. 5
      Transaction.js

5
Transaction.js

@ -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');

Loading…
Cancel
Save