aboutsummaryrefslogtreecommitdiff
path: root/src/banman.h
diff options
context:
space:
mode:
authorCory Fields <cory-nospam-@coryfields.com>2017-10-06 16:56:56 -0400
committerCarl Dong <accounts@carldong.me>2019-01-16 13:54:18 -0500
commitdaae598feb034f2f56e0b00ecfb4854d693d3641 (patch)
tree6c1e9cb8ddcca970d712c467d23a7db3b3e6e029 /src/banman.h
parent84fc3fbd0304a7d6e660bf783c84bed2dd415141 (diff)
banman: add thread annotations and mark members const where possible
Also remove misleading comment. ClearBanned is used by rpc as well.
Diffstat (limited to 'src/banman.h')
-rw-r--r--src/banman.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/banman.h b/src/banman.h
index 9339717158..61200dbe96 100644
--- a/src/banman.h
+++ b/src/banman.h
@@ -41,7 +41,7 @@ public:
BanMan(fs::path ban_file, CClientUIInterface* client_interface, int64_t default_ban_time);
void Ban(const CNetAddr& netAddr, const BanReason& banReason, int64_t bantimeoffset = 0, bool sinceUnixEpoch = false);
void Ban(const CSubNet& subNet, const BanReason& banReason, int64_t bantimeoffset = 0, bool sinceUnixEpoch = false);
- void ClearBanned(); // needed for unit testing
+ void ClearBanned();
bool IsBanned(CNetAddr netAddr);
bool IsBanned(CSubNet subNet);
bool Unban(const CNetAddr& netAddr);
@@ -57,12 +57,12 @@ private:
//!clean unused entries (if bantime has expired)
void SweepBanned();
- banmap_t m_banned;
CCriticalSection m_cs_banned;
- bool m_is_dirty;
+ banmap_t m_banned GUARDED_BY(m_cs_banned);
+ bool m_is_dirty GUARDED_BY(m_cs_banned);
CClientUIInterface* m_client_interface = nullptr;
CBanDB m_ban_db;
- int64_t m_default_ban_time;
+ const int64_t m_default_ban_time;
};
extern std::unique_ptr<BanMan> g_banman;