aboutsummaryrefslogtreecommitdiff
path: root/src/banman.h
diff options
context:
space:
mode:
authorHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2022-05-24 10:27:30 +0200
committerHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2022-05-24 10:27:30 +0200
commit37d150d8c5ffcb2bddcd99951a739e97571194c7 (patch)
tree6bc4ee0c8c66443e2fbe894a1b275873a28025ef /src/banman.h
parent0fb29087080a4e60d7c709ff5edf14e830ef3a69 (diff)
downloadbitcoin-37d150d8c5ffcb2bddcd99951a739e97571194c7.tar.xz
refactor: Add more negative `!m_banned_mutex` thread safety annotations
Could be verified with $ ./configure CC=clang CXX=clang++ CXXFLAGS='-Wthread-safety -Wthread-safety-negative' $ make clean $ make 2>&1 | grep m_banned_mutex
Diffstat (limited to 'src/banman.h')
-rw-r--r--src/banman.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/banman.h b/src/banman.h
index c0e07b866d..9200f07aaf 100644
--- a/src/banman.h
+++ b/src/banman.h
@@ -60,24 +60,24 @@ class BanMan
public:
~BanMan();
BanMan(fs::path ban_file, CClientUIInterface* client_interface, int64_t default_ban_time);
- 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();
+ void Ban(const CNetAddr& net_addr, int64_t ban_time_offset = 0, bool since_unix_epoch = false) EXCLUSIVE_LOCKS_REQUIRED(!m_banned_mutex);
+ void Ban(const CSubNet& sub_net, int64_t ban_time_offset = 0, bool since_unix_epoch = false) EXCLUSIVE_LOCKS_REQUIRED(!m_banned_mutex);
+ void Discourage(const CNetAddr& net_addr) EXCLUSIVE_LOCKS_REQUIRED(!m_banned_mutex);
+ void ClearBanned() EXCLUSIVE_LOCKS_REQUIRED(!m_banned_mutex);
//! Return whether net_addr is banned
- bool IsBanned(const CNetAddr& net_addr);
+ bool IsBanned(const CNetAddr& net_addr) EXCLUSIVE_LOCKS_REQUIRED(!m_banned_mutex);
//! Return whether sub_net is exactly banned
- bool IsBanned(const CSubNet& sub_net);
+ bool IsBanned(const CSubNet& sub_net) EXCLUSIVE_LOCKS_REQUIRED(!m_banned_mutex);
//! Return whether net_addr is discouraged.
- bool IsDiscouraged(const CNetAddr& net_addr);
+ bool IsDiscouraged(const CNetAddr& net_addr) EXCLUSIVE_LOCKS_REQUIRED(!m_banned_mutex);
- bool Unban(const CNetAddr& net_addr);
- bool Unban(const CSubNet& sub_net);
- void GetBanned(banmap_t& banmap);
- void DumpBanlist();
+ bool Unban(const CNetAddr& net_addr) EXCLUSIVE_LOCKS_REQUIRED(!m_banned_mutex);
+ bool Unban(const CSubNet& sub_net) EXCLUSIVE_LOCKS_REQUIRED(!m_banned_mutex);
+ void GetBanned(banmap_t& banmap) EXCLUSIVE_LOCKS_REQUIRED(!m_banned_mutex);
+ void DumpBanlist() EXCLUSIVE_LOCKS_REQUIRED(!m_banned_mutex);
private:
void LoadBanlist() EXCLUSIVE_LOCKS_REQUIRED(!m_banned_mutex);