mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-08 10:31:50 -05:00
refactor: Add thread safety annotation to BanMan::SweepBanned()
This commit is contained in:
parent
3919059deb
commit
52c0b3e859
2 changed files with 3 additions and 2 deletions
|
@ -179,10 +179,11 @@ void BanMan::GetBanned(banmap_t& banmap)
|
||||||
|
|
||||||
void BanMan::SweepBanned()
|
void BanMan::SweepBanned()
|
||||||
{
|
{
|
||||||
|
AssertLockHeld(m_cs_banned);
|
||||||
|
|
||||||
int64_t now = GetTime();
|
int64_t now = GetTime();
|
||||||
bool notify_ui = false;
|
bool notify_ui = false;
|
||||||
{
|
{
|
||||||
LOCK(m_cs_banned);
|
|
||||||
banmap_t::iterator it = m_banned.begin();
|
banmap_t::iterator it = m_banned.begin();
|
||||||
while (it != m_banned.end()) {
|
while (it != m_banned.end()) {
|
||||||
CSubNet sub_net = (*it).first;
|
CSubNet sub_net = (*it).first;
|
||||||
|
|
|
@ -85,7 +85,7 @@ private:
|
||||||
//!set the "dirty" flag for the banlist
|
//!set the "dirty" flag for the banlist
|
||||||
void SetBannedSetDirty(bool dirty = true);
|
void SetBannedSetDirty(bool dirty = true);
|
||||||
//!clean unused entries (if bantime has expired)
|
//!clean unused entries (if bantime has expired)
|
||||||
void SweepBanned();
|
void SweepBanned() EXCLUSIVE_LOCKS_REQUIRED(m_cs_banned);
|
||||||
|
|
||||||
RecursiveMutex m_cs_banned;
|
RecursiveMutex m_cs_banned;
|
||||||
banmap_t m_banned GUARDED_BY(m_cs_banned);
|
banmap_t m_banned GUARDED_BY(m_cs_banned);
|
||||||
|
|
Loading…
Add table
Reference in a new issue