diff --git a/lib/http/rpc.js b/lib/http/rpc.js index 2b0b51b3..5ec6efd1 100644 --- a/lib/http/rpc.js +++ b/lib/http/rpc.js @@ -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;