BanMan is not a bad Man, he’s just a different class of Man. He’s an ex-ConnMan Man, looking to take a different path and make a new namespace for himself.
Beware BanMan’s banhammer as he banishes bandits with the bandwidth to jam him. Not standing for non-canon, he’ll ban and he’ll ban. Some heroes wear capes, but BanMan? A Bandana.
–
Despite the diff size, this is mostly move-only. It breaks the ban/unban functions out of CConnman and into a new class because, while logically bans are tied to connections, they’re really just entries in a database. Like CConnman, a global is still required due to RPC (and qt). I plan to address this along with CAddrMan, which I’ll be breaking out next.
This also makes testing easier as different implementations can be dropped in.
There are a few small behavioral changes here, which are pretty insignificant:
- Banning no longer implies disconnecting. If you want both, you need to call both.
- For simplicity, The ban db is read in the constructor, meaning that it happens in init rather than net.
- RPC returns RPC_DATABASE_ERROR if the bandb is not loaded. This should not be possible now, but the idea is for future changes to allow us to disable p2p but still interact with the ban commands.