5#ifndef BITCOIN_BANMAN_H
6#define BITCOIN_BANMAN_H
static constexpr unsigned int DEFAULT_MISBEHAVING_BANTIME
static constexpr std::chrono::minutes DUMP_BANS_INTERVAL
How often to dump banned addresses/subnets to disk.
void DumpBanlist() EXCLUSIVE_LOCKS_REQUIRED(!m_banned_mutex)
void Ban(const CNetAddr &net_addr, int64_t ban_time_offset=0, bool since_unix_epoch=false) EXCLUSIVE_LOCKS_REQUIRED(!m_banned_mutex)
BanMan(fs::path ban_file, CClientUIInterface *client_interface, int64_t default_ban_time)
void SweepBanned() EXCLUSIVE_LOCKS_REQUIRED(m_banned_mutex)
clean unused entries (if bantime has expired)
const int64_t m_default_ban_time
bool IsBanned(const CNetAddr &net_addr) EXCLUSIVE_LOCKS_REQUIRED(!m_banned_mutex)
Return whether net_addr is banned.
banmap_t m_banned GUARDED_BY(m_banned_mutex)
void GetBanned(banmap_t &banmap) EXCLUSIVE_LOCKS_REQUIRED(!m_banned_mutex)
void ClearBanned() EXCLUSIVE_LOCKS_REQUIRED(!m_banned_mutex)
CRollingBloomFilter m_discouraged GUARDED_BY(m_banned_mutex)
void LoadBanlist() EXCLUSIVE_LOCKS_REQUIRED(!m_banned_mutex)
CClientUIInterface * m_client_interface
bool Unban(const CNetAddr &net_addr) EXCLUSIVE_LOCKS_REQUIRED(!m_banned_mutex)
bool IsDiscouraged(const CNetAddr &net_addr) EXCLUSIVE_LOCKS_REQUIRED(!m_banned_mutex)
Return whether net_addr is discouraged.
void Discourage(const CNetAddr &net_addr) EXCLUSIVE_LOCKS_REQUIRED(!m_banned_mutex)
bool m_is_dirty GUARDED_BY(m_banned_mutex)
Access to the banlist database (banlist.json)
Signals for UI communication.
RollingBloomFilter is a probabilistic "keep track of most recently inserted" set.
Path class wrapper to block calls to the fs::path(std::string) implicit constructor and the fs::path:...
std::map< CSubNet, CBanEntry > banmap_t
#define EXCLUSIVE_LOCKS_REQUIRED(...)