aboutsummaryrefslogtreecommitdiff
path: root/src/banman.cpp
diff options
context:
space:
mode:
authorHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2022-01-18 19:13:40 +0200
committerHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2022-01-28 19:27:25 +0000
commit83c76467157bbca023bffda0f0bc2f01eb76a040 (patch)
tree8d65820042a4cf8ac77cdf77c1f1d6ca93839fef /src/banman.cpp
parent33bda6ab87cc1b569e96da337296eb3e9ce6db1a (diff)
Avoid calling BanMan::SweepBanned() twice in a row
Diffstat (limited to 'src/banman.cpp')
-rw-r--r--src/banman.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/banman.cpp b/src/banman.cpp
index 2b029198db..87c1bbc89e 100644
--- a/src/banman.cpp
+++ b/src/banman.cpp
@@ -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);
}