diff options
author | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2022-01-18 19:18:02 +0200 |
---|---|---|
committer | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2022-05-24 09:34:05 +0200 |
commit | 46709c5f27bf6cbc8eba1298b04bd079da2cdded (patch) | |
tree | 59972ae55acb43e58b706536d15a2dc9fd761310 /src | |
parent | d88c0d8440cf640ef4f2c7a40b8b8b31bfd38f23 (diff) | |
download | bitcoin-46709c5f27bf6cbc8eba1298b04bd079da2cdded.tar.xz |
refactor: Get rid of `BanMan::SetBannedSetDirty()`
Diffstat (limited to 'src')
-rw-r--r-- | src/banman.cpp | 11 | ||||
-rw-r--r-- | src/banman.h | 2 |
2 files changed, 3 insertions, 10 deletions
diff --git a/src/banman.cpp b/src/banman.cpp index 50dc0750e1..5b2a179543 100644 --- a/src/banman.cpp +++ b/src/banman.cpp @@ -55,12 +55,13 @@ void BanMan::DumpBanlist() SweepBanned(); if (!m_is_dirty) return; banmap = m_banned; - SetBannedSetDirty(false); + m_is_dirty = false; } int64_t n_start = GetTimeMillis(); if (!m_ban_db.Write(banmap)) { - SetBannedSetDirty(true); + LOCK(m_cs_banned); + m_is_dirty = true; } LogPrint(BCLog::NET, "Flushed %d banned node addresses/subnets to disk %dms\n", banmap.size(), @@ -202,9 +203,3 @@ void BanMan::SweepBanned() m_client_interface->BannedListChanged(); } } - -void BanMan::SetBannedSetDirty(bool dirty) -{ - LOCK(m_cs_banned); //reuse m_banned lock for the m_is_dirty flag - m_is_dirty = dirty; -} diff --git a/src/banman.h b/src/banman.h index 7f3c74733e..7a032dfdd0 100644 --- a/src/banman.h +++ b/src/banman.h @@ -81,8 +81,6 @@ public: private: void LoadBanlist() EXCLUSIVE_LOCKS_REQUIRED(!m_cs_banned); - //!set the "dirty" flag for the banlist - void SetBannedSetDirty(bool dirty = true); //!clean unused entries (if bantime has expired) void SweepBanned() EXCLUSIVE_LOCKS_REQUIRED(m_cs_banned); |