mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-19 21:31:33 +02:00
Avoid calling BanMan::SweepBanned() twice in a row
This commit is contained in:
parent
33bda6ab87
commit
83c7646715
@ -43,16 +43,15 @@ void BanMan::DumpBanlist()
|
|||||||
static Mutex dump_mutex;
|
static Mutex dump_mutex;
|
||||||
LOCK(dump_mutex);
|
LOCK(dump_mutex);
|
||||||
|
|
||||||
|
banmap_t banmap;
|
||||||
{
|
{
|
||||||
LOCK(m_cs_banned);
|
LOCK(m_cs_banned);
|
||||||
SweepBanned();
|
SweepBanned();
|
||||||
if (!BannedSetIsDirty()) return;
|
if (!BannedSetIsDirty()) return;
|
||||||
|
banmap = m_banned;
|
||||||
}
|
}
|
||||||
|
|
||||||
int64_t n_start = GetTimeMillis();
|
int64_t n_start = GetTimeMillis();
|
||||||
|
|
||||||
banmap_t banmap;
|
|
||||||
GetBanned(banmap);
|
|
||||||
if (m_ban_db.Write(banmap)) {
|
if (m_ban_db.Write(banmap)) {
|
||||||
SetBannedSetDirty(false);
|
SetBannedSetDirty(false);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user