rpc: do not use weight pre-segwit (see 9fc7f0b).

This commit is contained in:
Christopher Jeffrey 2017-02-26 21:20:24 -08:00
parent 70d4de39ce
commit e49e877f17
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -1686,8 +1686,8 @@ RPC.prototype.__template = co(function* _template(version, coinbase, rules) {
maxtime: block.ts + 7200,
expires: block.ts + 7200,
sigoplimit: consensus.MAX_BLOCK_SIGOPS_COST / scale | 0,
sizelimit: consensus.MAX_RAW_BLOCK_SIZE,
weightlimit: consensus.MAX_BLOCK_WEIGHT,
sizelimit: consensus.MAX_BLOCK_SIZE,
weightlimit: undefined,
longpollid: this.chain.tip.rhash() + util.pad32(this._totalTX()),
submitold: false,
coinbaseaux: {
@ -1699,6 +1699,13 @@ RPC.prototype.__template = co(function* _template(version, coinbase, rules) {
transactions: txs
};
// See:
// bitcoin/bitcoin#9fc7f0bce94f1cea0239b1543227f22a3f3b9274
if (attempt.witness) {
json.sizelimit = consensus.MAX_RAW_BLOCK_SIZE;
json.weightlimit = consensus.MAX_BLOCK_WEIGHT;
}
if (coinbase) {
tx = attempt.coinbase;