rpc: some more gbt fixes.

This commit is contained in:
Christopher Jeffrey 2017-03-15 07:45:23 -07:00
parent 1a3dcbd277
commit ff80620e5e
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -1188,7 +1188,7 @@ RPC.prototype._createTemplate = co(function* _createTemplate(version, coinbase,
dep = index[input.prevout.hash]; dep = index[input.prevout.hash];
if (dep != null && deps.indexOf(dep) === -1) { if (dep != null && deps.indexOf(dep) === -1) {
assert(dep < i); assert(dep < i);
deps.push(dep); deps.push(dep + 1);
} }
} }
@ -1264,7 +1264,9 @@ RPC.prototype._createTemplate = co(function* _createTemplate(version, coinbase,
weightlimit: undefined, weightlimit: undefined,
longpollid: this.chain.tip.rhash() + util.pad32(this.totalTX()), longpollid: this.chain.tip.rhash() + util.pad32(this.totalTX()),
submitold: false, submitold: false,
coinbaseaux: undefined, coinbaseaux: {
flags: attempt.coinbaseFlags.toString('hex')
},
coinbasevalue: undefined, coinbasevalue: undefined,
coinbasetxn: undefined, coinbasetxn: undefined,
default_witness_commitment: undefined, default_witness_commitment: undefined,
@ -1304,9 +1306,6 @@ RPC.prototype._createTemplate = co(function* _createTemplate(version, coinbase,
weight: tx.getWeight() weight: tx.getWeight()
}; };
} else { } else {
json.coinbaseaux = {
flags: attempt.coinbaseFlags.toString('hex')
};
json.coinbasevalue = attempt.getReward(); json.coinbasevalue = attempt.getReward();
} }