Skip to content

Commit daae598

Browse files
theunidongcarl
authored andcommitted
banman: add thread annotations and mark members const where possible
Also remove misleading comment. ClearBanned is used by rpc as well.
1 parent 84fc3fb commit daae598

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/banman.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class BanMan
4141
BanMan(fs::path ban_file, CClientUIInterface* client_interface, int64_t default_ban_time);
4242
void Ban(const CNetAddr& netAddr, const BanReason& banReason, int64_t bantimeoffset = 0, bool sinceUnixEpoch = false);
4343
void Ban(const CSubNet& subNet, const BanReason& banReason, int64_t bantimeoffset = 0, bool sinceUnixEpoch = false);
44-
void ClearBanned(); // needed for unit testing
44+
void ClearBanned();
4545
bool IsBanned(CNetAddr netAddr);
4646
bool IsBanned(CSubNet subNet);
4747
bool Unban(const CNetAddr& netAddr);
@@ -57,12 +57,12 @@ class BanMan
5757
//!clean unused entries (if bantime has expired)
5858
void SweepBanned();
5959

60-
banmap_t m_banned;
6160
CCriticalSection m_cs_banned;
62-
bool m_is_dirty;
61+
banmap_t m_banned GUARDED_BY(m_cs_banned);
62+
bool m_is_dirty GUARDED_BY(m_cs_banned);
6363
CClientUIInterface* m_client_interface = nullptr;
6464
CBanDB m_ban_db;
65-
int64_t m_default_ban_time;
65+
const int64_t m_default_ban_time;
6666
};
6767

6868
extern std::unique_ptr<BanMan> g_banman;

0 commit comments

Comments
 (0)