From 1b0db7b984c49f40cf95c6f685c3c5c790f07606 Mon Sep 17 00:00:00 2001 From: Philip Kaufmann Date: Mon, 1 Jun 2015 09:09:51 +0200 Subject: [Qt] extend rpc console peers tab - add node id, ping wait, whitelisted and common height - rephrase some labels to make them easier to understand for users --- src/qt/rpcconsole.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'src/qt/rpcconsole.cpp') diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index e99972d498..73ee33cbd8 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -611,7 +611,8 @@ void RPCConsole::updateNodeDetail(const CNodeCombinedStats *stats) cachedNodeid = stats->nodeStats.nodeid; // update the detail ui with latest node information - QString peerAddrDetails(QString::fromStdString(stats->nodeStats.addrName)); + QString peerAddrDetails(QString::fromStdString(stats->nodeStats.addrName) + " "); + peerAddrDetails += tr("(node id: %1)").arg(QString::number(stats->nodeStats.nodeid)); if (!stats->nodeStats.addrLocal.empty()) peerAddrDetails += "
" + tr("via %1").arg(QString::fromStdString(stats->nodeStats.addrLocal)); ui->peerHeading->setText(peerAddrDetails); @@ -622,11 +623,13 @@ void RPCConsole::updateNodeDetail(const CNodeCombinedStats *stats) ui->peerBytesRecv->setText(FormatBytes(stats->nodeStats.nRecvBytes)); ui->peerConnTime->setText(GUIUtil::formatDurationStr(GetTime() - stats->nodeStats.nTimeConnected)); ui->peerPingTime->setText(GUIUtil::formatPingTime(stats->nodeStats.dPingTime)); + ui->peerPingWait->setText(GUIUtil::formatPingTime(stats->nodeStats.dPingWait)); ui->timeoffset->setText(GUIUtil::formatTimeOffset(stats->nodeStats.nTimeOffset)); - ui->peerVersion->setText(QString("%1").arg(stats->nodeStats.nVersion)); + ui->peerVersion->setText(QString("%1").arg(QString::number(stats->nodeStats.nVersion))); ui->peerSubversion->setText(QString::fromStdString(stats->nodeStats.cleanSubVer)); ui->peerDirection->setText(stats->nodeStats.fInbound ? tr("Inbound") : tr("Outbound")); - ui->peerHeight->setText(QString("%1").arg(stats->nodeStats.nStartingHeight)); + ui->peerHeight->setText(QString("%1").arg(QString::number(stats->nodeStats.nStartingHeight))); + ui->peerWhitelisted->setText(stats->nodeStats.fWhitelisted ? tr("Yes") : tr("No")); // This check fails for example if the lock was busy and // nodeStateStats couldn't be fetched. @@ -639,9 +642,12 @@ void RPCConsole::updateNodeDetail(const CNodeCombinedStats *stats) ui->peerSyncHeight->setText(QString("%1").arg(stats->nodeStateStats.nSyncHeight)); else ui->peerSyncHeight->setText(tr("Unknown")); - } else { - ui->peerBanScore->setText(tr("Fetching...")); - ui->peerSyncHeight->setText(tr("Fetching...")); + + // Common height is init to -1 + if (stats->nodeStateStats.nCommonHeight > -1) + ui->peerCommonHeight->setText(QString("%1").arg(stats->nodeStateStats.nCommonHeight)); + else + ui->peerCommonHeight->setText(tr("Unknown")); } ui->detailWidget->show(); -- cgit v1.2.3