Skip to content

Commit 46709c5

Browse files
committed
refactor: Get rid of BanMan::SetBannedSetDirty()
1 parent d88c0d8 commit 46709c5

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

src/banman.cpp

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,13 @@ void BanMan::DumpBanlist()
5555
SweepBanned();
5656
if (!m_is_dirty) return;
5757
banmap = m_banned;
58-
SetBannedSetDirty(false);
58+
m_is_dirty = false;
5959
}
6060

6161
int64_t n_start = GetTimeMillis();
6262
if (!m_ban_db.Write(banmap)) {
63-
SetBannedSetDirty(true);
63+
LOCK(m_cs_banned);
64+
m_is_dirty = true;
6465
}
6566

6667
LogPrint(BCLog::NET, "Flushed %d banned node addresses/subnets to disk %dms\n", banmap.size(),
@@ -202,9 +203,3 @@ void BanMan::SweepBanned()
202203
m_client_interface->BannedListChanged();
203204
}
204205
}
205-
206-
void BanMan::SetBannedSetDirty(bool dirty)
207-
{
208-
LOCK(m_cs_banned); //reuse m_banned lock for the m_is_dirty flag
209-
m_is_dirty = dirty;
210-
}

src/banman.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,6 @@ class BanMan
8181

8282
private:
8383
void LoadBanlist() EXCLUSIVE_LOCKS_REQUIRED(!m_cs_banned);
84-
//!set the "dirty" flag for the banlist
85-
void SetBannedSetDirty(bool dirty = true);
8684
//!clean unused entries (if bantime has expired)
8785
void SweepBanned() EXCLUSIVE_LOCKS_REQUIRED(m_cs_banned);
8886

0 commit comments

Comments
 (0)