aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/mining.cpp
diff options
context:
space:
mode:
authorLuke Dashjr <luke-jr+git@utopios.org>2017-01-23 23:39:07 +0000
committerLuke Dashjr <luke-jr+git@utopios.org>2017-02-02 20:00:25 +0000
commit9fc7f0bce94f1cea0239b1543227f22a3f3b9274 (patch)
tree16d1f860a1acbdfae9f4581ad2b10ced4f79d72f /src/rpc/mining.cpp
parent1c2edd9f6707d16c03ecfba094b1cfec2ddc4dce (diff)
downloadbitcoin-9fc7f0bce94f1cea0239b1543227f22a3f3b9274.tar.xz
Bugfix: RPC/Mining: GBT should return 1 MB sizelimit before segwit activates
Diffstat (limited to 'src/rpc/mining.cpp')
-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)));