doc: Fix `fee` field in `getblock` RPC result
What changed, and why it matters
This commit is a one-line documentation fix. It marks the 'fee' field in the getblock RPC help output as optional, matching the actual behavior where the field is omitted when block undo data is not available. There is no code behavior change and no security impact.
No security action needed. This is a documentation-only correction.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change adds /optional=/true to the RPCResult declaration for the ‘fee’ field in getblock verbosity 2/3. This only affects the generated RPC help/schema documentation. Runtime code is unchanged; the field was already omitted in practice when undo data is unavailable.
Changed components
src/rpc/blockchain.cppgetblock RPC documentationInspect captured patch +1 / −1
diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp
index 475c5ca4..d97b7c6c 100644
--- a/src/rpc/blockchain.cpp
+++ b/src/rpc/blockchain.cpp
@@ -816,7 +816,7 @@ static RPCHelpMan getblock()
{RPCResult::Type::OBJ, "", "",
{
{RPCResult::Type::ELISION, "", "The transactions in the format of the getrawtransaction RPC. Different from verbosity = 1 \"tx\" result"},
- {RPCResult::Type::NUM, "fee", "The transaction fee in " + CURRENCY_UNIT + ", omitted if block undo data is not available"},
+ {RPCResult::Type::NUM, "fee", /*optional=*/true, "The transaction fee in " + CURRENCY_UNIT + ", omitted if block undo data is not available"},
}},
}},
}},
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.