1177@@ -1178,8 +1178,12 @@ void RPCConsole::updateDetailWidget()
1178 ui->peerPingTime->setText(GUIUtil::formatPingTime(stats->nodeStats.m_last_ping_time));
1179 ui->peerMinPing->setText(GUIUtil::formatPingTime(stats->nodeStats.m_min_ping_time));
1180 ui->timeoffset->setText(GUIUtil::formatTimeOffset(stats->nodeStats.nTimeOffset));
1181- ui->peerVersion->setText(QString::number(stats->nodeStats.nVersion));
1182- ui->peerSubversion->setText(QString::fromStdString(stats->nodeStats.cleanSubVer));
1183+ if (stats->nodeStats.nVersion) {
1184+ ui->peerVersion->setText(QString::number(stats->nodeStats.nVersion));
1185+ }
1186+ if (!stats->nodeStats.cleanSubVer.empty()) {
What if the peer actually sends an empty subver?
In that case only the version is displayed.
That has a non-empty subver… “/Satoshi:22.0.0/”
Maybe I’m confused; I’m aware of the -uacomment
config option, but how would one send an empty subver (is it a conf option in a different implementation)?
It would have to be a very old or hacked/custom client. But showing “N/A” in that case seems wrong?
“N/A” for such a case (have never seen it tbh) doesn’t seem unreasonable to me, but we could display nothing ("") if the subver is empty and the peer connection is set up.