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

Method BanMan

src/banman.cpp:16–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14
15
16BanMan::BanMan(fs::path ban_file, CClientUIInterface* client_interface, int64_t default_ban_time)
17 : m_client_interface(client_interface), m_ban_db(std::move(ban_file)), m_default_ban_time(default_ban_time)
18{
19 if (m_client_interface) m_client_interface->InitMessage(_("Loading banlist…").translated);
20
21 int64_t n_start = GetTimeMillis();
22 if (m_ban_db.Read(m_banned)) {
23 SweepBanned(); // sweep out unused entries
24
25 LogPrint(BCLog::NET, "Loaded %d banned node addresses/subnets %dms\n", m_banned.size(),
26 GetTimeMillis() - n_start);
27 } else {
28 LogPrintf("Recreating the banlist database\n");
29 m_banned = {};
30 m_is_dirty = true;
31 }
32
33 DumpBanlist();
34}
35
36BanMan::~BanMan()
37{

Callers

nothing calls this directly

Calls 5

_Function · 0.85
GetTimeMillisFunction · 0.85
InitMessageMethod · 0.80
ReadMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected