Skip to content

Commit

Permalink
banman: add thread annotations and mark members const where possible
Browse files Browse the repository at this point in the history
Also remove misleading comment. ClearBanned is used by rpc as well.
  • Loading branch information
theuni authored and dongcarl committed Jan 16, 2019
1 parent 84fc3fb commit daae598
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/banman.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class BanMan
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);
Expand All @@ -57,12 +57,12 @@ class BanMan
//!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;
Expand Down

0 comments on commit daae598

Please sign in to comment.