mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 10:43:19 -03:00
refactor: Remove redundant scope in BanMan::SweepBanned()
This commit is contained in:
parent
52c0b3e859
commit
ab75388320
1 changed files with 12 additions and 12 deletions
|
@ -183,20 +183,20 @@ void BanMan::SweepBanned()
|
||||||
|
|
||||||
int64_t now = GetTime();
|
int64_t now = GetTime();
|
||||||
bool notify_ui = false;
|
bool notify_ui = false;
|
||||||
{
|
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;
|
CBanEntry ban_entry = (*it).second;
|
||||||
CBanEntry ban_entry = (*it).second;
|
if (!sub_net.IsValid() || now > ban_entry.nBanUntil) {
|
||||||
if (!sub_net.IsValid() || now > ban_entry.nBanUntil) {
|
m_banned.erase(it++);
|
||||||
m_banned.erase(it++);
|
m_is_dirty = true;
|
||||||
m_is_dirty = true;
|
notify_ui = true;
|
||||||
notify_ui = true;
|
LogPrint(BCLog::NET, "Removed banned node address/subnet: %s\n", sub_net.ToString());
|
||||||
LogPrint(BCLog::NET, "Removed banned node address/subnet: %s\n", sub_net.ToString());
|
} else {
|
||||||
} else
|
++it;
|
||||||
++it;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// update UI
|
// update UI
|
||||||
if (notify_ui && m_client_interface) {
|
if (notify_ui && m_client_interface) {
|
||||||
m_client_interface->BannedListChanged();
|
m_client_interface->BannedListChanged();
|
||||||
|
|
Loading…
Add table
Reference in a new issue