v31.1-roots.1 · Commit 5: [PATCH 05/17] feat(net): preserve Roots peer controls and health view on v31
src/qt/rpcconsole.cpp
Before: src/qt/rpcconsole.cpp · After: src/qt/rpcconsole.cpp
File metadata
index d30a8acff623f73864c00cd5d97e843025877ae5..70079699e7d4c7006af31072f459e5affbaed7a4 100644
Download original patch · Release notes
Diff rows 1–45 of 45. Line numbers refer to the original before/after files.
+ Added− RemovedUnmarked lines are context.
Scroll the code area horizontally to read long lines. Before is on the left; after is on the right. Unified view fits narrow screens more easily.
src/qt/rpcconsole.cpp
CHANGED
|
@@ -1184,6 +1184,7 @@ void RPCConsole::updateDetailWidget()
|
|
| 1184 |
ui->peerSessionId->setVisible(true);
|
| 1185 |
ui->peerSessionId->setText(QString::fromStdString(stats->nodeStats.m_session_id));
|
| 1186 |
} else {
|
|
|
|
| 1187 |
ui->peerSessionIdLabel->setVisible(false);
|
| 1188 |
ui->peerSessionId->setVisible(false);
|
| 1189 |
}
|
|
@@ -1199,6 +1200,8 @@ void RPCConsole::updateDetailWidget()
|
|
| 1199 |
}
|
| 1200 |
ui->peerMappedAS->setText(stats->nodeStats.m_mapped_as != 0 ? QString::number(stats->nodeStats.m_mapped_as) : ts.na);
|
| 1201 |
|
|
|
|
|
|
|
| 1202 |
// This check fails for example if the lock was busy and
|
| 1203 |
// nodeStateStats couldn't be fetched.
|
| 1204 |
if (stats->fNodeStateStatsAvailable) {
|
|
@@ -1216,6 +1219,7 @@ void RPCConsole::updateDetailWidget()
|
|
| 1216 |
} else {
|
| 1217 |
ui->peerCommonHeight->setText(ts.unknown);
|
| 1218 |
}
|
|
|
|
| 1219 |
ui->peerPingWait->setText(GUIUtil::formatPingTime(stats->nodeStateStats.m_ping_wait));
|
| 1220 |
ui->peerAddrRelayEnabled->setText(stats->nodeStateStats.m_addr_relay_enabled ? ts.yes : ts.no);
|
| 1221 |
ui->peerAddrProcessed->setText(QString::number(stats->nodeStateStats.m_addr_processed));
|
|
@@ -1227,6 +1231,23 @@ void RPCConsole::updateDetailWidget()
|
|
| 1227 |
ui->peersTabRightPanel->show();
|
| 1228 |
}
|
| 1229 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1230 |
void RPCConsole::resizeEvent(QResizeEvent *event)
|
| 1231 |
{
|
| 1232 |
QWidget::resizeEvent(event);
|
|
|
|
| 1184 |
ui->peerSessionId->setVisible(true);
|
| 1185 |
ui->peerSessionId->setText(QString::fromStdString(stats->nodeStats.m_session_id));
|
| 1186 |
} else {
|
| 1187 |
+
ui->peerSessionId->clear();
|
| 1188 |
ui->peerSessionIdLabel->setVisible(false);
|
| 1189 |
ui->peerSessionId->setVisible(false);
|
| 1190 |
}
|
|
|
|
| 1200 |
}
|
| 1201 |
ui->peerMappedAS->setText(stats->nodeStats.m_mapped_as != 0 ? QString::number(stats->nodeStats.m_mapped_as) : ts.na);
|
| 1202 |
|
| 1203 |
+
resetPeerStateStats();
|
| 1204 |
+
|
| 1205 |
// This check fails for example if the lock was busy and
|
| 1206 |
// nodeStateStats couldn't be fetched.
|
| 1207 |
if (stats->fNodeStateStatsAvailable) {
|
|
|
|
| 1219 |
} else {
|
| 1220 |
ui->peerCommonHeight->setText(ts.unknown);
|
| 1221 |
}
|
| 1222 |
+
ui->peerHeight->setText(stats->nodeStateStats.m_starting_height >= 0 ? QString::number(stats->nodeStateStats.m_starting_height) : ts.unknown);
|
| 1223 |
ui->peerPingWait->setText(GUIUtil::formatPingTime(stats->nodeStateStats.m_ping_wait));
|
| 1224 |
ui->peerAddrRelayEnabled->setText(stats->nodeStateStats.m_addr_relay_enabled ? ts.yes : ts.no);
|
| 1225 |
ui->peerAddrProcessed->setText(QString::number(stats->nodeStateStats.m_addr_processed));
|
|
|
|
| 1231 |
ui->peersTabRightPanel->show();
|
| 1232 |
}
|
| 1233 |
|
| 1234 |
+
void RPCConsole::resetPeerStateStats()
|
| 1235 |
+
{
|
| 1236 |
+
// State stats can be unavailable when the non-blocking cs_main acquisition
|
| 1237 |
+
// loses a refresh race. Clear them first so a newly selected peer never
|
| 1238 |
+
// shows state from an earlier selection.
|
| 1239 |
+
ui->timeoffset->setText(ts.na);
|
| 1240 |
+
ui->peerServices->setText(ts.na);
|
| 1241 |
+
ui->peerSyncHeight->setText(ts.unknown);
|
| 1242 |
+
ui->peerCommonHeight->setText(ts.unknown);
|
| 1243 |
+
ui->peerHeight->setText(ts.unknown);
|
| 1244 |
+
ui->peerPingWait->setText(ts.na);
|
| 1245 |
+
ui->peerAddrRelayEnabled->setText(ts.na);
|
| 1246 |
+
ui->peerAddrProcessed->setText(ts.na);
|
| 1247 |
+
ui->peerAddrRateLimited->setText(ts.na);
|
| 1248 |
+
ui->peerRelayTxes->setText(ts.na);
|
| 1249 |
+
}
|
| 1250 |
+
|
| 1251 |
void RPCConsole::resizeEvent(QResizeEvent *event)
|
| 1252 |
{
|
| 1253 |
QWidget::resizeEvent(event);
|