Skip to content

Commit 83c7646

Browse files
committed
Avoid calling BanMan::SweepBanned() twice in a row
1 parent 33bda6a commit 83c7646

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/banman.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,15 @@ void BanMan::DumpBanlist()
4343
static Mutex dump_mutex;
4444
LOCK(dump_mutex);
4545

46+
banmap_t banmap;
4647
{
4748
LOCK(m_cs_banned);
4849
SweepBanned();
4950
if (!BannedSetIsDirty()) return;
51+
banmap = m_banned;
5052
}
5153

5254
int64_t n_start = GetTimeMillis();
53-
54-
banmap_t banmap;
55-
GetBanned(banmap);
5655
if (m_ban_db.Write(banmap)) {
5756
SetBannedSetDirty(false);
5857
}

0 commit comments

Comments
 (0)