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

Method refreshBanlist

src/qt/bantablemodel.cpp:47–65  ·  view source on GitHub ↗

Pull a full list of banned nodes from CNode into our cache */

Source from the content-addressed store, hash-verified

45
46 /** Pull a full list of banned nodes from CNode into our cache */
47 void refreshBanlist(interfaces::Node& node)
48 {
49 banmap_t banMap;
50 node.getBanned(banMap);
51
52 cachedBanlist.clear();
53 cachedBanlist.reserve(banMap.size());
54 for (const auto& entry : banMap)
55 {
56 CCombinedBan banEntry;
57 banEntry.subnet = entry.first;
58 banEntry.banEntry = entry.second;
59 cachedBanlist.append(banEntry);
60 }
61
62 if (sortColumn >= 0)
63 // sort cachedBanlist (use stable sort to prevent rows jumping around unnecessarily)
64 std::stable_sort(cachedBanlist.begin(), cachedBanlist.end(), BannedNodeLessThan(sortColumn, sortOrder));
65 }
66
67 int size() const
68 {

Callers 1

refreshMethod · 0.80

Calls 7

BannedNodeLessThanClass · 0.85
getBannedMethod · 0.80
clearMethod · 0.45
reserveMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected