diff options
author | Cory Fields <cory-nospam-@coryfields.com> | 2017-10-05 13:35:20 -0400 |
---|---|---|
committer | Carl Dong <accounts@carldong.me> | 2019-01-16 13:54:18 -0500 |
commit | 2e56702ecedd83c4b7cb8de9de5c437c8c08e645 (patch) | |
tree | 8ceb655d5556a7b97a6362d1940e5b8ae0a307e0 /src/addrdb.cpp | |
parent | 4c0d961eb0d7825a1e6f8389d7f5545114ee18c6 (diff) |
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.
Diffstat (limited to 'src/addrdb.cpp')
-rw-r--r-- | src/addrdb.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/addrdb.cpp b/src/addrdb.cpp index 1590bce074..c6083f5554 100644 --- a/src/addrdb.cpp +++ b/src/addrdb.cpp @@ -105,19 +105,18 @@ bool DeserializeFileDB(const fs::path& path, Data& data) } -CBanDB::CBanDB() +CBanDB::CBanDB(fs::path ban_list_path) : m_ban_list_path(std::move(ban_list_path)) { - pathBanlist = GetDataDir() / "banlist.dat"; } bool CBanDB::Write(const banmap_t& banSet) { - return SerializeFileDB("banlist", pathBanlist, banSet); + return SerializeFileDB("banlist", m_ban_list_path, banSet); } bool CBanDB::Read(banmap_t& banSet) { - return DeserializeFileDB(pathBanlist, banSet); + return DeserializeFileDB(m_ban_list_path, banSet); } CAddrDB::CAddrDB() |