diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2017-02-20 17:31:52 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2017-02-20 17:32:02 +0100 |
commit | aa791e29114f200739f0ec654b753861549e529c (patch) | |
tree | 431bc6a1e04a4ad95be6d96f05d1230993578ae1 /src | |
parent | 2dad02232af1456fb298f17cdbc3f8eea96f1a7c (diff) | |
parent | 279f944e8d3b437d31210f3ba3e798e98a9334fc (diff) |
Merge #9619: Bugfix: RPC/Mining: GBT should return 1 MB sizelimit before segwit activates
279f944 QA: Test GBT size/weight limit values (Luke Dashjr)
9fc7f0b Bugfix: RPC/Mining: GBT should return 1 MB sizelimit before segwit activates (Luke Dashjr)
Diffstat (limited to 'src')
-rw-r--r-- | src/rpc/mining.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp index c594daca0d..77cd282a3d 100644 --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -676,8 +676,12 @@ UniValue getblocktemplate(const JSONRPCRequest& request) nSigOpLimit /= WITNESS_SCALE_FACTOR; } result.push_back(Pair("sigoplimit", nSigOpLimit)); - result.push_back(Pair("sizelimit", (int64_t)MAX_BLOCK_SERIALIZED_SIZE)); - result.push_back(Pair("weightlimit", (int64_t)MAX_BLOCK_WEIGHT)); + if (fPreSegWit) { + result.push_back(Pair("sizelimit", (int64_t)MAX_BLOCK_BASE_SIZE)); + } else { + result.push_back(Pair("sizelimit", (int64_t)MAX_BLOCK_SERIALIZED_SIZE)); + result.push_back(Pair("weightlimit", (int64_t)MAX_BLOCK_WEIGHT)); + } result.push_back(Pair("curtime", pblock->GetBlockTime())); result.push_back(Pair("bits", strprintf("%08x", pblock->nBits))); result.push_back(Pair("height", (int64_t)(pindexPrev->nHeight+1))); |