Skip to content

rpc: help metadata fixes#35513

Open
RuslanProgrammer wants to merge 2 commits into
bitcoin:masterfrom
RuslanProgrammer:rpc-help-metadata-fixes
Open

rpc: help metadata fixes#35513
RuslanProgrammer wants to merge 2 commits into
bitcoin:masterfrom
RuslanProgrammer:rpc-help-metadata-fixes

Conversation

@RuslanProgrammer

Copy link
Copy Markdown

Align RPC help documentation with actual implementation.

@DrahtBot

DrahtBot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Code Coverage & Benchmarks

For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/35513.

Reviews

See the guideline for information on the review process.
A summary of reviews will appear here.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #34628 (p2p: Replace per-peer transaction rate-limiting with global rate limits by ajtowns)
  • #33741 (rpc: Optionally print feerates in sat/vb by polespinasa)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@pinheadmz

Copy link
Copy Markdown
Member

Please squash your commits

Comment thread src/rpc/blockchain.cpp Outdated
"4. \"valid-fork\" This branch is not part of the active chain, but is fully validated\n"
"5. \"active\" This is the tip of the active main chain, which is certainly valid"},
"5. \"active\" This is the tip of the active main chain, which is certainly valid\n"
"6. \"unknown\" Status could not be determined"},

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain how to trigger this? This is uncovered code according to https://maflcko.github.io/b-c-cov/total.coverage/src/rpc/blockchain.cpp.gcov.html

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, there is no known trigger.
I only added it to show what the implementation could theoretically return

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think documenting something unreachable helps "align the docs" and this can be droped.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possibly this could be a NONFATAL_UNREACHABLE, but I haven't looked closely.

Comment thread src/rpc/net.cpp Outdated
{RPCResult::Type::NUM, "connections", /*optional=*/true, "the total number of connections"},
{RPCResult::Type::NUM, "connections_in", /*optional=*/true, "the number of inbound connections"},
{RPCResult::Type::NUM, "connections_out", /*optional=*/true, "the number of outbound connections"},
{RPCResult::Type::BOOL, "networkactive", /*optional=*/true, "whether p2p networking is enabled"},

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is wrong/dead code.

The correct fix would be to just require connman. See EnsureAny in src/rpc/server_util.h

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In aadb3b5

Agree, we should require connman (and peerman and mempool) using the helper(s).

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@RuslanProgrammer
RuslanProgrammer force-pushed the rpc-help-metadata-fixes branch from aadb3b5 to ac6a44b Compare July 1, 2026 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants