diff --git a/src/banman.cpp b/src/banman.cpp index 901d91809e..02c70be584 100644 --- a/src/banman.cpp +++ b/src/banman.cpp @@ -179,10 +179,11 @@ void BanMan::GetBanned(banmap_t& banmap) void BanMan::SweepBanned() { + AssertLockHeld(m_cs_banned); + int64_t now = GetTime(); bool notify_ui = false; { - LOCK(m_cs_banned); banmap_t::iterator it = m_banned.begin(); while (it != m_banned.end()) { CSubNet sub_net = (*it).first; diff --git a/src/banman.h b/src/banman.h index b037b8869b..77b043f081 100644 --- a/src/banman.h +++ b/src/banman.h @@ -85,7 +85,7 @@ private: //!set the "dirty" flag for the banlist void SetBannedSetDirty(bool dirty = true); //!clean unused entries (if bantime has expired) - void SweepBanned(); + void SweepBanned() EXCLUSIVE_LOCKS_REQUIRED(m_cs_banned); RecursiveMutex m_cs_banned; banmap_t m_banned GUARDED_BY(m_cs_banned);