aboutsummaryrefslogtreecommitdiff
path: root/src/banman.cpp
diff options
context:
space:
mode:
authorHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2022-05-20 15:20:42 +0200
committerHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2022-05-20 15:20:42 +0200
commitab7538832043a6c15e45a178fb6bb6298a00108f (patch)
treefae5966bdf2a4e2912ac171957b654103e0e1a6a /src/banman.cpp
parent52c0b3e859089c0ac98e7261ded6391b4f8eeeaf (diff)
refactor: Remove redundant scope in `BanMan::SweepBanned()`
Diffstat (limited to 'src/banman.cpp')
-rw-r--r--src/banman.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/banman.cpp b/src/banman.cpp
index 02c70be584..2a6e0e010f 100644
--- a/src/banman.cpp
+++ b/src/banman.cpp
@@ -183,20 +183,20 @@ void BanMan::SweepBanned()
int64_t now = GetTime();
bool notify_ui = false;
- {
- banmap_t::iterator it = m_banned.begin();
- while (it != m_banned.end()) {
- CSubNet sub_net = (*it).first;
- CBanEntry ban_entry = (*it).second;
- if (!sub_net.IsValid() || now > ban_entry.nBanUntil) {
- m_banned.erase(it++);
- m_is_dirty = true;
- notify_ui = true;
- LogPrint(BCLog::NET, "Removed banned node address/subnet: %s\n", sub_net.ToString());
- } else
- ++it;
+ banmap_t::iterator it = m_banned.begin();
+ while (it != m_banned.end()) {
+ CSubNet sub_net = (*it).first;
+ CBanEntry ban_entry = (*it).second;
+ if (!sub_net.IsValid() || now > ban_entry.nBanUntil) {
+ m_banned.erase(it++);
+ m_is_dirty = true;
+ notify_ui = true;
+ LogPrint(BCLog::NET, "Removed banned node address/subnet: %s\n", sub_net.ToString());
+ } else {
+ ++it;
}
}
+
// update UI
if (notify_ui && m_client_interface) {
m_client_interface->BannedListChanged();