Make getblocktemplate return correct block limits

This commit is contained in:
Tom Zander
2016-02-18 14:40:13 +00:00
parent a8a6d7de39
commit 1b797210d7

View File

@@ -371,6 +371,7 @@ UniValue getblocktemplate(const UniValue& params, bool fHelp)
" ],\n"
" \"noncerange\" : \"00000000ffffffff\", (string) A range of valid nonces\n"
" \"sigoplimit\" : n, (numeric) limit of sigops in blocks\n"
" \"sighashlimit\" : n, (numeric) limit of sighash-bytes in blocks\n"
" \"sizelimit\" : n, (numeric) limit of block size\n"
" \"curtime\" : ttt, (numeric) current timestamp in seconds since epoch (Jan 1 1970 GMT)\n"
" \"bits\" : \"xxx\", (string) compressed target of next block\n"
@@ -581,7 +582,8 @@ UniValue getblocktemplate(const UniValue& params, bool fHelp)
result.push_back(Pair("mintime", (int64_t)pindexPrev->GetMedianTimePast()+1));
result.push_back(Pair("mutable", aMutable));
result.push_back(Pair("noncerange", "00000000ffffffff"));
result.push_back(Pair("sigoplimit", (int64_t)MAX_BLOCK_SIGOPS));
result.push_back(Pair("sigoplimit", static_cast<int64_t>(MaxBlockSigops(pblock->nTime))));
result.push_back(Pair("sighashlimit", static_cast<int64_t>(MaxBlockSighash(pblock->nTime))));
result.push_back(Pair("sizelimit", (int64_t)MaxBlockSize(pblock->nTime)));
result.push_back(Pair("curtime", pblock->GetBlockTime()));
result.push_back(Pair("bits", strprintf("%08x", pblock->nBits)));