From ff80620e5e62661cc48dcc87ab7c7d80787e5e50 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Wed, 15 Mar 2017 07:45:23 -0700 Subject: [PATCH] rpc: some more gbt fixes. --- lib/http/rpc.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/http/rpc.js b/lib/http/rpc.js index 30b3fcd6..7d0a406e 100644 --- a/lib/http/rpc.js +++ b/lib/http/rpc.js @@ -1188,7 +1188,7 @@ RPC.prototype._createTemplate = co(function* _createTemplate(version, coinbase, dep = index[input.prevout.hash]; if (dep != null && deps.indexOf(dep) === -1) { assert(dep < i); - deps.push(dep); + deps.push(dep + 1); } } @@ -1264,7 +1264,9 @@ RPC.prototype._createTemplate = co(function* _createTemplate(version, coinbase, weightlimit: undefined, longpollid: this.chain.tip.rhash() + util.pad32(this.totalTX()), submitold: false, - coinbaseaux: undefined, + coinbaseaux: { + flags: attempt.coinbaseFlags.toString('hex') + }, coinbasevalue: undefined, coinbasetxn: undefined, default_witness_commitment: undefined, @@ -1304,9 +1306,6 @@ RPC.prototype._createTemplate = co(function* _createTemplate(version, coinbase, weight: tx.getWeight() }; } else { - json.coinbaseaux = { - flags: attempt.coinbaseFlags.toString('hex') - }; json.coinbasevalue = attempt.getReward(); }