Avoid calling BanMan::SweepBanned() twice in a row

This commit is contained in:
Hennadii Stepanov
2022-01-18 19:13:40 +02:00
parent 33bda6ab87
commit 83c7646715

View File

@@ -43,16 +43,15 @@ void BanMan::DumpBanlist()
static Mutex dump_mutex;
LOCK(dump_mutex);
banmap_t banmap;
{
LOCK(m_cs_banned);
SweepBanned();
if (!BannedSetIsDirty()) return;
banmap = m_banned;
}
int64_t n_start = GetTimeMillis();
banmap_t banmap;
GetBanned(banmap);
if (m_ban_db.Write(banmap)) {
SetBannedSetDirty(false);
}