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

@@ -133,7 +133,7 @@ public:
// between nodes running old code and nodes running
// new code.
~BanMan();
BanMan(CClientUIInterface* client_interface);
BanMan(fs::path ban_file, CClientUIInterface* client_interface);
void Ban(const CNetAddr& netAddr, const BanReason& reason, int64_t bantimeoffset = 0, bool sinceUnixEpoch = false);
void Ban(const CSubNet& subNet, const BanReason& reason, int64_t bantimeoffset = 0, bool sinceUnixEpoch = false);
void ClearBanned(); // needed for unit testing
@@ -156,6 +156,7 @@ private:
CCriticalSection cs_setBanned;
bool setBannedIsDirty;
CClientUIInterface* clientInterface = nullptr;
CBanDB m_ban_db;
};
class NetEventsInterface;