| 172 | } |
| 173 | |
| 174 | void BanMan::SweepBanned() |
| 175 | { |
| 176 | int64_t now = GetTime(); |
| 177 | bool notify_ui = false; |
| 178 | { |
| 179 | LOCK(m_cs_banned); |
| 180 | banmap_t::iterator it = m_banned.begin(); |
| 181 | while (it != m_banned.end()) { |
| 182 | CSubNet sub_net = (*it).first; |
| 183 | CBanEntry ban_entry = (*it).second; |
| 184 | if (!sub_net.IsValid() || now > ban_entry.nBanUntil) { |
| 185 | m_banned.erase(it++); |
| 186 | m_is_dirty = true; |
| 187 | notify_ui = true; |
| 188 | LogPrint(BCLog::NET, "Removed banned node address/subnet: %s\n", sub_net.ToString()); |
| 189 | } else |
| 190 | ++it; |
| 191 | } |
| 192 | } |
| 193 | // update UI |
| 194 | if (notify_ui && m_client_interface) { |
| 195 | m_client_interface->BannedListChanged(); |
| 196 | } |
| 197 | } |
| 198 | |
| 199 | bool BanMan::BannedSetIsDirty() |
| 200 | { |