0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-10 10:52:31 -05:00

qt, refactor: Drop no longer used PeerTableModel::getRowByNodeId func

This commit is contained in:
Hennadii Stepanov 2021-02-22 09:53:06 +02:00
parent 9a9f180df0
commit 5a4a15d2b4
No known key found for this signature in database
GPG key ID: 410108112E7EA81F
2 changed files with 0 additions and 20 deletions

View file

@ -20,13 +20,10 @@ class PeerTablePriv
public: public:
/** Local cache of peer information */ /** Local cache of peer information */
QList<CNodeCombinedStats> cachedNodeStats; QList<CNodeCombinedStats> cachedNodeStats;
/** Index of rows by node ID */
std::map<NodeId, int> mapNodeRows;
/** 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;
@ -40,13 +37,6 @@ public:
stats.nodeStateStats = std::get<2>(node_stats); stats.nodeStateStats = std::get<2>(node_stats);
cachedNodeStats.append(stats); cachedNodeStats.append(stats);
} }
}
// build index map
mapNodeRows.clear();
int row = 0;
for (const CNodeCombinedStats& stats : cachedNodeStats)
mapNodeRows.insert(std::pair<NodeId, int>(stats.nodeStats.nodeid, row++));
} }
int size() const int size() const
@ -198,12 +188,3 @@ void PeerTableModel::refresh()
priv->refreshPeers(m_node); priv->refreshPeers(m_node);
Q_EMIT layoutChanged(); Q_EMIT layoutChanged();
} }
int PeerTableModel::getRowByNodeId(NodeId nodeid)
{
std::map<NodeId, int>::iterator it = priv->mapNodeRows.find(nodeid);
if (it == priv->mapNodeRows.end())
return -1;
return it->second;
}

View file

@ -41,7 +41,6 @@ class PeerTableModel : public QAbstractTableModel
public: public:
explicit PeerTableModel(interfaces::Node& node, QObject* parent); explicit PeerTableModel(interfaces::Node& node, QObject* parent);
~PeerTableModel(); ~PeerTableModel();
int getRowByNodeId(NodeId nodeid);
void startAutoRefresh(); void startAutoRefresh();
void stopAutoRefresh(); void stopAutoRefresh();