From d0469b2e9386a7a4b268cb9725347e7517acace6 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Thu, 5 Oct 2017 13:41:45 -0400 Subject: banman: pass in default ban time as a parameter Removes the dependency on arg parsing. --- src/net.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/net.cpp') diff --git a/src/net.cpp b/src/net.cpp index fd74c58292..f6491bc8db 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -537,7 +537,7 @@ void BanMan::Ban(const CSubNet& subNet, const BanReason &banReason, int64_t bant banEntry.banReason = banReason; if (bantimeoffset <= 0) { - bantimeoffset = gArgs.GetArg("-bantime", DEFAULT_MISBEHAVING_BANTIME); + bantimeoffset = m_default_ban_time; sinceUnixEpoch = false; } banEntry.nBanUntil = (sinceUnixEpoch ? 0 : GetTime() )+bantimeoffset; @@ -2430,7 +2430,7 @@ bool CConnman::Start(CScheduler& scheduler, const Options& connOptions) return true; } -BanMan::BanMan(fs::path ban_file, CClientUIInterface* client_interface) : clientInterface(client_interface), m_ban_db(std::move(ban_file)) +BanMan::BanMan(fs::path ban_file, CClientUIInterface* client_interface, int64_t default_ban_time) : clientInterface(client_interface), m_ban_db(std::move(ban_file)), m_default_ban_time(default_ban_time) { if (clientInterface) clientInterface->InitMessage(_("Loading banlist...")); -- cgit v1.2.3