Skip to content

Commit 777434a

Browse files
committed
doc: rpc: improve getmininginfo help text
- The reserved weight of the coinbase transaction is an estimate and may not reflect the exact value; it can be lower. - It should be clear that `currentblockweight` includes the reserved coinbase transaction weight. whereas `currentblocktx` does not account for the coinbase transaction count. - Also clarify `m_last_block_num_txs` and `m_last_block_weight`
1 parent c8acd40 commit 777434a

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/node/miner.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,9 @@ class BlockAssembler
176176
/** Construct a new block template */
177177
std::unique_ptr<CBlockTemplate> CreateNewBlock();
178178

179+
/** The number of transactions in the last assembled block (excluding coinbase transaction) */
179180
inline static std::optional<int64_t> m_last_block_num_txs{};
181+
/** The weight of the last assembled block (including reserved weight for block header, txs count and coinbase tx) */
180182
inline static std::optional<int64_t> m_last_block_weight{};
181183

182184
private:

src/rpc/mining.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,8 +419,8 @@ static RPCHelpMan getmininginfo()
419419
RPCResult::Type::OBJ, "", "",
420420
{
421421
{RPCResult::Type::NUM, "blocks", "The current block"},
422-
{RPCResult::Type::NUM, "currentblockweight", /*optional=*/true, "The block weight of the last assembled block (only present if a block was ever assembled)"},
423-
{RPCResult::Type::NUM, "currentblocktx", /*optional=*/true, "The number of block transactions of the last assembled block (only present if a block was ever assembled)"},
422+
{RPCResult::Type::NUM, "currentblockweight", /*optional=*/true, "The block weight (including reserved weight for block header, txs count and coinbase tx) of the last assembled block (only present if a block was ever assembled)"},
423+
{RPCResult::Type::NUM, "currentblocktx", /*optional=*/true, "The number of block transactions (excluding coinbase) of the last assembled block (only present if a block was ever assembled)"},
424424
{RPCResult::Type::STR_HEX, "bits", "The current nBits, compact representation of the block difficulty target"},
425425
{RPCResult::Type::NUM, "difficulty", "The current difficulty"},
426426
{RPCResult::Type::STR_HEX, "target", "The current target"},

0 commit comments

Comments
 (0)