35 "Loaded %d banned node ips/subnets from banlist.dat %dms\n",
66 "Flushed %d banned node ips/subnets to banlist.dat %dms\n",
198 banmap_t::iterator it =
m_banned.begin();
208 "%s: Removed banned node ip/subnet from banlist.dat: %s\n",
void Discourage(const CNetAddr &net_addr)
void Ban(const CNetAddr &net_addr, int64_t ban_time_offset=0, bool since_unix_epoch=false)
const int64_t m_default_ban_time
void GetBanned(banmap_t &banmap)
bool IsBanned(const CNetAddr &net_addr)
Return whether net_addr is banned.
RecursiveMutex m_cs_banned
void SetBanned(const banmap_t &banmap)
CClientUIInterface * m_client_interface
bool Unban(const CNetAddr &net_addr)
BanMan(fs::path ban_file, const CChainParams &chainparams, CClientUIInterface *client_interface, int64_t default_ban_time)
void SetBannedSetDirty(bool dirty=true)
set the "dirty" flag for the banlist
void SweepBanned()
clean unused entries (if bantime has expired)
bool IsDiscouraged(const CNetAddr &net_addr)
Return whether net_addr is discouraged.
bool Write(const banmap_t &banSet)
bool Read(banmap_t &banSet)
CChainParams defines various tweakable parameters of a given instance of the Bitcoin system.
Signals for UI communication.
Path class wrapper to block calls to the fs::path(std::string) implicit constructor and the fs::path:...
#define LogPrint(category,...)
Implement std::hash so RCUPtr can be used as a key for maps or sets.
std::map< CSubNet, CBanEntry > banmap_t
T GetRand(T nMax=std::numeric_limits< T >::max()) noexcept
Generate a uniform random integer of type T in the range [0..nMax) nMax defaults to std::numeric_limi...
int64_t GetTimeMillis()
Returns the system time (not mockable)
int64_t GetTime()
DEPRECATED Use either ClockType::now() or Now<TimePointType>() if a cast is needed.
bilingual_str _(const char *psz)
Translation function.