mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-05-23 04:16:52 +02:00
Make getblocktemplate return correct block limits
This commit is contained in:
@@ -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)));
|
||||
|
||||
Reference in New Issue
Block a user