aboutsummaryrefslogtreecommitdiff
path: root/src/rpc
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2017-02-20 17:31:52 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2017-02-20 17:32:02 +0100
commitaa791e29114f200739f0ec654b753861549e529c (patch)
tree431bc6a1e04a4ad95be6d96f05d1230993578ae1 /src/rpc
parent2dad02232af1456fb298f17cdbc3f8eea96f1a7c (diff)
parent279f944e8d3b437d31210f3ba3e798e98a9334fc (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/rpc')
-rw-r--r--src/rpc/mining.cpp8
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)));