Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
qt, refactor: Drop no longer used PeerTableModel::getRowByNodeId func
  • Loading branch information
hebasto committed Mar 7, 2021
commit 5a4a15d2b4456272fd8aa080195f40a09576ae01
19 changes: 0 additions & 19 deletions src/qt/peertablemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,10 @@ class PeerTablePriv
public:
/** Local cache of peer information */
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 */
void refreshPeers(interfaces::Node& node)
{
{
cachedNodeStats.clear();

interfaces::Node::NodesStats nodes_stats;
Expand All @@ -40,13 +37,6 @@ class PeerTablePriv
stats.nodeStateStats = std::get<2>(node_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
Expand Down Expand Up @@ -198,12 +188,3 @@ void PeerTableModel::refresh()
priv->refreshPeers(m_node);
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;
}
1 change: 0 additions & 1 deletion src/qt/peertablemodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ class PeerTableModel : public QAbstractTableModel
public:
explicit PeerTableModel(interfaces::Node& node, QObject* parent);
~PeerTableModel();
int getRowByNodeId(NodeId nodeid);
void startAutoRefresh();
void stopAutoRefresh();

Expand Down