Changeset View
Changeset View
Standalone View
Standalone View
src/qt/peertablemodel.cpp
Show First 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | public: | ||||
/** Pull a full list of peers from vNodes into our cache */ | /** Pull a full list of peers from vNodes into our cache */ | ||||
void refreshPeers(interfaces::Node &node) { | void refreshPeers(interfaces::Node &node) { | ||||
{ | { | ||||
cachedNodeStats.clear(); | cachedNodeStats.clear(); | ||||
interfaces::Node::NodesStats nodes_stats; | interfaces::Node::NodesStats nodes_stats; | ||||
node.getNodesStats(nodes_stats); | node.getNodesStats(nodes_stats); | ||||
cachedNodeStats.reserve(nodes_stats.size()); | cachedNodeStats.reserve(nodes_stats.size()); | ||||
for (auto &node_stats : nodes_stats) { | for (const auto &node_stats : nodes_stats) { | ||||
CNodeCombinedStats stats; | CNodeCombinedStats stats; | ||||
stats.nodeStats = std::get<0>(node_stats); | stats.nodeStats = std::get<0>(node_stats); | ||||
stats.fNodeStateStatsAvailable = std::get<1>(node_stats); | stats.fNodeStateStatsAvailable = std::get<1>(node_stats); | ||||
stats.nodeStateStats = std::get<2>(node_stats); | stats.nodeStateStats = std::get<2>(node_stats); | ||||
cachedNodeStats.append(stats); | cachedNodeStats.append(stats); | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 146 Lines • Show Last 20 Lines |