diff options
author | Pieter Wuille <pieter@wuille.net> | 2020-06-10 17:11:38 -0700 |
---|---|---|
committer | Pieter Wuille <pieter@wuille.net> | 2020-07-03 20:43:55 -0700 |
commit | 2ad58381fffb33d611abf900b73d9e6b5a4e35f8 (patch) | |
tree | 8794dd741e4616bcf129da6e274a822a9952e53b /src/banman.h | |
parent | b691f2df5f7d443c0c9ee056ab94aa0fc19566d5 (diff) |
Clean up separated ban/discourage interface
Diffstat (limited to 'src/banman.h')
-rw-r--r-- | src/banman.h | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/banman.h b/src/banman.h index aad73c514f..f6bfbd1e49 100644 --- a/src/banman.h +++ b/src/banman.h @@ -59,12 +59,20 @@ class BanMan public: ~BanMan(); BanMan(fs::path ban_file, CClientUIInterface* client_interface, int64_t default_ban_time); - void Ban(const CNetAddr& net_addr, const BanReason& ban_reason, int64_t ban_time_offset = 0, bool since_unix_epoch = false); - void Ban(const CSubNet& sub_net, const BanReason& ban_reason, int64_t ban_time_offset = 0, bool since_unix_epoch = false); + void Ban(const CNetAddr& net_addr, int64_t ban_time_offset = 0, bool since_unix_epoch = false); + void Ban(const CSubNet& sub_net, int64_t ban_time_offset = 0, bool since_unix_epoch = false); + void Discourage(const CNetAddr& net_addr); void ClearBanned(); - int IsBannedLevel(CNetAddr net_addr); - bool IsBanned(CNetAddr net_addr); - bool IsBanned(CSubNet sub_net); + + //! Return whether net_addr is banned + bool IsBanned(const CNetAddr& net_addr); + + //! Return whether sub_net is exactly banned + bool IsBanned(const CSubNet& sub_net); + + //! Return whether net_addr is discouraged. + bool IsDiscouraged(const CNetAddr& net_addr); + bool Unban(const CNetAddr& net_addr); bool Unban(const CSubNet& sub_net); void GetBanned(banmap_t& banmap); |