Ignore banlist.dat

This also allows to remove the "dirty" argument, which can now be
deduced from the return value of Read().
This commit is contained in:
MarcoFalke
2021-07-28 20:00:23 +02:00
parent 4b1fb50def
commit fa384fdd0b
6 changed files with 13 additions and 18 deletions

View File

@@ -197,16 +197,15 @@ bool CBanDB::Write(const banmap_t& banSet)
return false;
}
bool CBanDB::Read(banmap_t& banSet, bool& dirty)
bool CBanDB::Read(banmap_t& banSet)
{
// If the JSON banlist does not exist, then try to read the non-upgraded banlist.dat.
if (!fs::exists(m_banlist_json)) {
// If this succeeds then we need to flush to disk in order to create the JSON banlist.
dirty = true;
return DeserializeFileDB(m_banlist_dat, banSet, CLIENT_VERSION);
if (fs::exists(m_banlist_dat)) {
LogPrintf("banlist.dat ignored because it can only be read by " PACKAGE_NAME " version 22.x. Remove %s to silence this warning.\n", m_banlist_dat);
}
// If the JSON banlist does not exist, then recreate it
if (!fs::exists(m_banlist_json)) {
return false;
}
dirty = false;
std::map<std::string, util::SettingsValue> settings;
std::vector<std::string> errors;