MCPcopy Create free account
hub / github.com/ElementsProject/elements / SweepBanned

Method SweepBanned

src/banman.cpp:174–197  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

172}
173
174void 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
199bool BanMan::BannedSetIsDirty()
200{

Callers

nothing calls this directly

Calls 7

GetTimeFunction · 0.85
BannedListChangedMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
IsValidMethod · 0.45
eraseMethod · 0.45
ToStringMethod · 0.45

Tested by

no test coverage detected