@@ -623,9 +623,11 @@ static RPCHelpMan getblocktemplate()
623623 }},
624624 {RPCResult::Type::STR_HEX, " noncerange" , " A range of valid nonces" },
625625 {RPCResult::Type::NUM, " sigops" , /* optional=*/ true , " number of sigops in the next block (debug only)" },
626+ {RPCResult::Type::NUM, " coinbase_reserved_sigops" , /* optional=*/ true , " number of sigops the coinbase can safely use (debug only)" },
626627 {RPCResult::Type::NUM, " sigoplimit" , " limit of sigops in blocks" },
627628 {RPCResult::Type::NUM, " sizelimit" , " limit of block size" },
628- {RPCResult::Type::NUM, " weightlimit" , /* optional=*/ true , " limit of block weight" },
629+ {RPCResult::Type::NUM, " weightlimit" , " limit of block weight" },
630+ {RPCResult::Type::NUM, " coinbase_reserved_weight" , /* optional=*/ true , " maximum weight the coinbase can safely use (debug only)" },
629631 {RPCResult::Type::NUM_TIME, " curtime" , " current timestamp in " + UNIX_EPOCH_TIME},
630632 {RPCResult::Type::STR, " bits" , " compressed target of next block" },
631633 {RPCResult::Type::NUM, " height" , " The height of the next block" },
@@ -930,13 +932,15 @@ static RPCHelpMan getblocktemplate()
930932
931933 // Belt-and-suspenders check for the sigops limit:
932934 const int64_t nSigOpLimit = MAX_BLOCK_SIGOPS_COST;
933- CHECK_NONFATAL (block_sigops <= MAX_BLOCK_SIGOPS_COST);
935+ CHECK_NONFATAL (block_sigops + COINBASE_RESERVED_SIGOPS <= MAX_BLOCK_SIGOPS_COST);
934936 if (debug) result.pushKV (" sigops" , block_sigops);
937+ if (debug) result.pushKV (" coinbase_reserved_sigops" , COINBASE_RESERVED_SIGOPS);
935938 result.pushKV (" sigoplimit" , nSigOpLimit);
936939
937940 int64_t nSizeLimit = MAX_BLOCK_SERIALIZED_SIZE;
938941 result.pushKV (" sizelimit" , nSizeLimit);
939942 result.pushKV (" weightlimit" , (int64_t )MAX_BLOCK_WEIGHT);
943+ if (debug) result.pushKV (" coinbase_reserved_weight" , COINBASE_RESERVED_WEIGHT);
940944 result.pushKV (" curtime" , pblock->GetBlockTime ());
941945 result.pushKV (" bits" , strprintf (" %08x" , pblock->nBits ));
942946 result.pushKV (" height" , (int64_t )(pindexPrev->nHeight +1 ));
0 commit comments