Skip to content

Commit 9fc7f0b

Browse files
committed
Bugfix: RPC/Mining: GBT should return 1 MB sizelimit before segwit activates
1 parent 1c2edd9 commit 9fc7f0b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/rpc/mining.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -676,8 +676,12 @@ UniValue getblocktemplate(const JSONRPCRequest& request)
676676
nSigOpLimit /= WITNESS_SCALE_FACTOR;
677677
}
678678
result.push_back(Pair("sigoplimit", nSigOpLimit));
679-
result.push_back(Pair("sizelimit", (int64_t)MAX_BLOCK_SERIALIZED_SIZE));
680-
result.push_back(Pair("weightlimit", (int64_t)MAX_BLOCK_WEIGHT));
679+
if (fPreSegWit) {
680+
result.push_back(Pair("sizelimit", (int64_t)MAX_BLOCK_BASE_SIZE));
681+
} else {
682+
result.push_back(Pair("sizelimit", (int64_t)MAX_BLOCK_SERIALIZED_SIZE));
683+
result.push_back(Pair("weightlimit", (int64_t)MAX_BLOCK_WEIGHT));
684+
}
681685
result.push_back(Pair("curtime", pblock->GetBlockTime()));
682686
result.push_back(Pair("bits", strprintf("%08x", pblock->nBits)));
683687
result.push_back(Pair("height", (int64_t)(pindexPrev->nHeight+1)));

0 commit comments

Comments
 (0)