This PR adds Ensure{any}Banman functions to avoid code repetition and make it cleaner. Same approach as done with argsman, chainman, connman and others.
net: add `Ensure{any}Banman` #27069
pull brunoerg wants to merge 1 commits into bitcoin:master from brunoerg:2023-02-ensureanybanman changing 3 files +26 −17-
brunoerg commented at 8:29 PM on February 9, 2023: contributor
-
2d955ff006
net: add `Ensure{any}Banman`
it adds `Ensure{any}Banman` functions to avoid code repetition and make it cleaner. Similar approach as done with argsman, chainman, connman and others. -
DrahtBot commented at 8:29 PM on February 9, 2023: contributor
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--021abf342d371248e50ceaed478a90ca-->
Reviews
See the guideline for information on the review process.
Type Reviewers ACK davidgumberg If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.
- DrahtBot added the label P2P on Feb 9, 2023
-
davidgumberg commented at 2:35 AM on February 10, 2023: contributor
ACK 2d955ff
-
in src/rpc/net.cpp:704 in 2d955ff006
701 | @@ -702,9 +702,7 @@ static RPCHelpMan setban() 702 | throw std::runtime_error(help.ToString()); 703 | } 704 | NodeContext& node = EnsureAnyNodeContext(request.context);
maflcko commented at 8:20 AM on February 10, 2023:why not use EnsureAnyBanman here?
brunoerg commented at 2:07 PM on February 10, 2023:Because we need
connmanto disconnect the node right after banning.
brunoerg commented at 2:08 PM on February 10, 2023:e.g:
banman.Ban(subNet, banTime, absolute); if (node.connman) { node.connman->DisconnectNode(subNet); }maflcko merged this on Feb 10, 2023maflcko closed this on Feb 10, 2023sidhujag referenced this in commit 448bcf2fde on Feb 10, 2023bitcoin locked this on Feb 10, 2024ContributorsLabels
github-metadata-mirror
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-22 09:13 UTC
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-22 09:13 UTC
This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me
More mirrored repositories can be found on mirror.b10c.me