From 9aa210bccb65933e35c3911a67002a71d10414f9 Mon Sep 17 00:00:00 2001 From: olalonde Date: Fri, 11 Apr 2014 18:08:07 +0800 Subject: [PATCH 1/3] TxIn: add sequence to standardized object --- Transaction.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Transaction.js b/Transaction.js index fe06563..f3a8dd0 100644 --- a/Transaction.js +++ b/Transaction.js @@ -432,7 +432,8 @@ Transaction.prototype.getStandardizedObject = function getStandardizedObject() { prev_out: { hash: buffertools.reverse(new Buffer(txin.getOutpointHash())).toString('hex'), n: txin.getOutpointIndex() - } + }, + sequence: (txin.q === 0xffffffff) ? null : txin.q }; if (txin.isCoinBase()) { txinObj.coinbase = txin.s.toString('hex'); From 91a857f424ac2ac2a6e1065530da1ce3ba889152 Mon Sep 17 00:00:00 2001 From: olalonde Date: Fri, 11 Apr 2014 23:50:32 +0800 Subject: [PATCH 2/3] TxIn: don't set sequence to null if 0xffffffff --- Transaction.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Transaction.js b/Transaction.js index f3a8dd0..20d86e8 100644 --- a/Transaction.js +++ b/Transaction.js @@ -433,7 +433,7 @@ Transaction.prototype.getStandardizedObject = function getStandardizedObject() { hash: buffertools.reverse(new Buffer(txin.getOutpointHash())).toString('hex'), n: txin.getOutpointIndex() }, - sequence: (txin.q === 0xffffffff) ? null : txin.q + sequence: txin.q }; if (txin.isCoinBase()) { txinObj.coinbase = txin.s.toString('hex'); From 174a3ca17c41a7c5895c97295eb68ee4cba5a23a Mon Sep 17 00:00:00 2001 From: olalonde Date: Sat, 12 Apr 2014 00:33:06 +0800 Subject: [PATCH 3/3] Transaction: set TransactionIn.MAX_SEQUENCE constant --- Transaction.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Transaction.js b/Transaction.js index 20d86e8..a97a8b7 100644 --- a/Transaction.js +++ b/Transaction.js @@ -40,6 +40,8 @@ function TransactionIn(data) { this.q = data.q ? data.q : data.sequence; } +TransactionIn.MAX_SEQUENCE = 0xffffffff; + TransactionIn.prototype.getScript = function getScript() { return new Script(this.s); };