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: contributorThis PR adds
-
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
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
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: contributorACK 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 needconnmanto disconnect the node right after banning.
brunoerg commented at 2:08 pm on February 10, 2023:e.g:
0banman.Ban(subNet, banTime, absolute); 1if (node.connman) { 2 node.connman->DisconnectNode(subNet); 3}maflcko merged this on Feb 10, 2023maflcko closed this on Feb 10, 2023
sidhujag referenced this in commit 448bcf2fde on Feb 10, 2023bitcoin locked this on Feb 10, 2024
brunoerg
DrahtBot
davidgumberg
maflcko
Labels
P2P
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-02-17 06: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-02-17 06: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