Initially motivated by: https://github.com/bitcoin/bitcoin/pull/19219/files#r442410269
Objectives:
- Consolidate
BanManfunctions - Throw fewer RPC errors. If user intent is accomplished, the command is successful even if no change was made.
Changes:
- Remove
BanMan::Ban(CNetAddr&)and useBanMan::Ban(CSubNet&)instead (ips are subnets of one)- RPC change:
setban subnet/ip addnow allows adding a ban entry for an ip in an already banned subnet. No error will be thrown so long as the user intent is accomplished.
- RPC change:
- Remove
BanMan::Unban(CNetAddr&)and useBanMan::Unban(CSubNet&)instead (ips are subnets of one)- RPC change: Unbanning a non-banned subnet will no longer raise an rpc error as user intent is accomplished.
- Remove unused
BanMan::IsBanned(CSubNet&) - RPC change: Add
setban ip removeallto remove all ban entries that include an IP address - RPC change: Add
listbanned ipto return all ban entries that include an IP address