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

Method DumpBanlist

src/banman.cpp:41–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39}
40
41void BanMan::DumpBanlist()
42{
43 static Mutex dump_mutex;
44 LOCK(dump_mutex);
45
46 banmap_t banmap;
47 {
48 LOCK(m_cs_banned);
49 SweepBanned();
50 if (!BannedSetIsDirty()) return;
51 banmap = m_banned;
52 SetBannedSetDirty(false);
53 }
54
55 int64_t n_start = GetTimeMillis();
56 if (!m_ban_db.Write(banmap)) {
57 SetBannedSetDirty(true);
58 }
59
60 LogPrint(BCLog::NET, "Flushed %d banned node addresses/subnets to disk %dms\n", banmap.size(),
61 GetTimeMillis() - n_start);
62}
63
64void BanMan::ClearBanned()
65{

Callers 2

AppInitMainFunction · 0.80
FUZZ_TARGET_INITFunction · 0.80

Calls 3

GetTimeMillisFunction · 0.85
WriteMethod · 0.45
sizeMethod · 0.45

Tested by 1

FUZZ_TARGET_INITFunction · 0.64