Pull a full list of banned nodes from CNode into our cache */
| 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 | { |