diff options
author | Cory Fields <cory-nospam-@coryfields.com> | 2017-10-05 13:41:45 -0400 |
---|---|---|
committer | Carl Dong <accounts@carldong.me> | 2019-01-16 13:54:18 -0500 |
commit | d0469b2e9386a7a4b268cb9725347e7517acace6 (patch) | |
tree | 77e13e31bd2204de782afafe03c1e71203392c71 /src/net.cpp | |
parent | 2e56702ecedd83c4b7cb8de9de5c437c8c08e645 (diff) | |
download | bitcoin-d0469b2e9386a7a4b268cb9725347e7517acace6.tar.xz |
banman: pass in default ban time as a parameter
Removes the dependency on arg parsing.
Diffstat (limited to 'src/net.cpp')
-rw-r--r-- | src/net.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
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...")); |