Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
19 changes: 18 additions & 1 deletion src/qt/peertablemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,24 @@ QVariant PeerTableModel::data(const QModelIndex &index, int role) const
} // no default case, so the compiler can warn about missing cases
assert(false);
} else if (role == StatsRole) {
return QVariant::fromValue(rec);
switch (index.column()) {
case NetNodeId:
return QVariant::fromValue(rec);
case Address:
return QString::fromStdString(rec->nodeStats.addrName);
case ConnectionType:
[[fallthrough]];
case Network:
[[fallthrough]];
case Ping:
[[fallthrough]];
case Sent:
[[fallthrough]];
case Received:
[[fallthrough]];
case Subversion:
return {};
} // no default case, so the compiler can warn about missing cases
}

return QVariant();
Expand Down
4 changes: 4 additions & 0 deletions src/qt/rpcconsole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,10 @@ void RPCConsole::setClientModel(ClientModel *model, int bestblock_height, int64_

// create peer table context menu
peersTableContextMenu = new QMenu(this);
peersTableContextMenu->addAction(tr("Copy address"), [this] {
GUIUtil::copyEntryData(ui->peerWidget, PeerTableModel::Address, PeerTableModel::StatsRole);
});
peersTableContextMenu->addSeparator();
peersTableContextMenu->addAction(tr("Disconnect"), this, &RPCConsole::disconnectSelectedNode);
peersTableContextMenu->addAction(ts.ban_for + " " + tr("1 hour"), [this] { banSelectedNode(60 * 60); });
peersTableContextMenu->addAction(ts.ban_for + " " + tr("1 day"), [this] { banSelectedNode(60 * 60 * 24); });
Expand Down