MCPcopy Create free account
hub / github.com/LUX-Core/lux / DumpBanlist

Function DumpBanlist

src/net.cpp:2645–2662  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2643}
2644
2645void DumpBanlist()
2646{
2647 CNode::SweepBanned(); // clean unused entries (if bantime has expired)
2648
2649 if (!CNode::BannedSetIsDirty())
2650 return;
2651
2652 int64_t nStart = GetTimeMillis();
2653
2654 CBanDB bandb;
2655 banmap_t banmap;
2656 CNode::GetBanned(banmap);
2657 if (bandb.Write(banmap))
2658 CNode::SetBannedSetDirty(false);
2659
2660 LogPrint("net", "Flushed %d banned node ips/subnets to banlist.dat %dms\n",
2661 banmap.size(), GetTimeMillis() - nStart);
2662}
2663
2664int64_t nNextSend(int64_t nNow, int average_interval_seconds) {
2665 return nNow + (int64_t)(log1p(GetRand(1ULL << 48)

Callers 4

setbanFunction · 0.85
clearbannedFunction · 0.85
DumpDataFunction · 0.85
StartNodeFunction · 0.85

Calls 4

GetTimeMillisFunction · 0.85
LogPrintFunction · 0.85
WriteMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected