Skip to content

Commit ab75388

Browse files
committed
refactor: Remove redundant scope in BanMan::SweepBanned()
1 parent 52c0b3e commit ab75388

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/banman.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -183,20 +183,20 @@ void BanMan::SweepBanned()
183183

184184
int64_t now = GetTime();
185185
bool notify_ui = false;
186-
{
187-
banmap_t::iterator it = m_banned.begin();
188-
while (it != m_banned.end()) {
189-
CSubNet sub_net = (*it).first;
190-
CBanEntry ban_entry = (*it).second;
191-
if (!sub_net.IsValid() || now > ban_entry.nBanUntil) {
192-
m_banned.erase(it++);
193-
m_is_dirty = true;
194-
notify_ui = true;
195-
LogPrint(BCLog::NET, "Removed banned node address/subnet: %s\n", sub_net.ToString());
196-
} else
197-
++it;
186+
banmap_t::iterator it = m_banned.begin();
187+
while (it != m_banned.end()) {
188+
CSubNet sub_net = (*it).first;
189+
CBanEntry ban_entry = (*it).second;
190+
if (!sub_net.IsValid() || now > ban_entry.nBanUntil) {
191+
m_banned.erase(it++);
192+
m_is_dirty = true;
193+
notify_ui = true;
194+
LogPrint(BCLog::NET, "Removed banned node address/subnet: %s\n", sub_net.ToString());
195+
} else {
196+
++it;
198197
}
199198
}
199+
200200
// update UI
201201
if (notify_ui && m_client_interface) {
202202
m_client_interface->BannedListChanged();

0 commit comments

Comments
 (0)