banman: pass the banfile path in

There's no need to hard-code the path here. Passing it in means that there are
no ordering concerns wrt establishing the datadir.
This commit is contained in:
Cory Fields
2017-10-05 13:35:20 -04:00
committed by Carl Dong
parent 4c0d961eb0
commit 2e56702ece
7 changed files with 15 additions and 18 deletions

View File

@@ -1296,7 +1296,7 @@ bool AppInitMain(InitInterfaces& interfaces)
// need to reindex later.
assert(!g_banman);
g_banman = MakeUnique<BanMan>(&uiInterface);
g_banman = MakeUnique<BanMan>(GetDataDir() / "banlist.dat", &uiInterface);
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())));