mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 22:18:54 +01:00
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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user