35 const auto start{SteadyClock::now()};
42 LogInfo(
"Recreating the banlist database");
62 const auto start{SteadyClock::now()};
188 banmap_t::iterator it =
m_banned.begin();
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.
void GetBanned(banmap_t &banmap) EXCLUSIVE_LOCKS_REQUIRED(!m_banned_mutex)
void ClearBanned() EXCLUSIVE_LOCKS_REQUIRED(!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 Write(const banmap_t &banSet)
bool Read(banmap_t &banSet)
Read the banlist from disk.
Signals for UI communication.
#define LogDebug(category,...)
std::map< CSubNet, CBanEntry > banmap_t
#define AssertLockHeld(cs)
consteval auto _(util::TranslatedLiteral str)
int64_t GetTime()
DEPRECATED Use either ClockType::now() or Now<TimePointType>() if a cast is needed.
constexpr auto Ticks(Dur2 d)
Helper to count the seconds of a duration/time_point.