diff --git a/src/qt/peertablemodel.cpp b/src/qt/peertablemodel.cpp index 6c4e3260119..354e4c05376 100644 --- a/src/qt/peertablemodel.cpp +++ b/src/qt/peertablemodel.cpp @@ -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(); diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index 006f60e7a1c..8f37ba6b319 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -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); });