banman: pass in default ban time as a parameter

Removes the dependency on arg parsing.
This commit is contained in:
Cory Fields
2017-10-05 13:41:45 -04:00
committed by Carl Dong
parent 2e56702ece
commit d0469b2e93
5 changed files with 9 additions and 8 deletions

View File

@@ -1296,7 +1296,7 @@ bool AppInitMain(InitInterfaces& interfaces)
// need to reindex later.
assert(!g_banman);
g_banman = MakeUnique<BanMan>(GetDataDir() / "banlist.dat", &uiInterface);
g_banman = MakeUnique<BanMan>(GetDataDir() / "banlist.dat", &uiInterface, gArgs.GetArg("-bantime", DEFAULT_MISBEHAVING_BANTIME));
assert(!g_connman);
g_connman = std::unique_ptr<CConnman>(new CConnman(GetRand(std::numeric_limits<uint64_t>::max()), GetRand(std::numeric_limits<uint64_t>::max())));