aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Dashjr <luke-jr+git@utopios.org>2017-01-23 23:39:07 +0000
committerWladimir J. van der Laan <laanwj@gmail.com>2017-02-20 17:32:59 +0100
commit6552729f38eadefa1531aeee13d7a07427c0c076 (patch)
tree038735c095b51ea652967923cc460e91cfce7ff4
parent40c754cb38cdc8bc27cfcfe3af8be869d4eab969 (diff)
downloadbitcoin-6552729f38eadefa1531aeee13d7a07427c0c076.tar.xz
Bugfix: RPC/Mining: GBT should return 1 MB sizelimit before segwit activates
Github-Pull: #9619 Rebased-From: 9fc7f0bce94f1cea0239b1543227f22a3f3b9274
-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)));