Use fallback value for Version and User Agent during peer connection#673
Conversation
…tion During connection setup for a peer, getpeerinfo returns "version": 0, "subver": "" and the GUI Peers window displays 0 and an empty field, respectively. Give these fields the same behavior as the other fields in the GUI Peers window: display the fallback value in src/qt/forms/debugwindow.ui (i.e. "N/A") until a valid result is available after the peer connection completes.
|
Thanks @jarolrod! I noticed this because these fields can occasionally remain in the "connection setup" stage for a few seconds. |
…gent during peer connection c2a21c0 gui: use fallback value for Version and User Agent during peer connection (Jon Atack) Pull request description: During connection setup for a peer, getpeerinfo returns `"version": 0, "subver": ""` and the GUI Peers window displays 0 and an empty field, respectively. Give these fields the same behavior as the other fields in the GUI Peers window: display the fallback value in `src/qt/forms/debugwindow.ui` (i.e. `N/A`) until a valid result is available after the peer connection completes. An alternative would be to display nothing for both, as is the case currently for User Agent. ACKs for top commit: jarolrod: ACK c2a21c0 furszy: code ACK c2a21c0 Tree-SHA512: 4f0060fa9abde120a2bb48c9dcc87894d9bb70c33e6ab43b22400a4bcd0ceff0fa098adf7f385b0a7a4cf5d7053463b36fe1232e19a8d5025eecd8db9833f73b
| if (stats->nodeStats.nVersion) { | ||
| ui->peerVersion->setText(QString::number(stats->nodeStats.nVersion)); | ||
| } | ||
| if (!stats->nodeStats.cleanSubVer.empty()) { |
There was a problem hiding this comment.
What if the peer actually sends an empty subver?
There was a problem hiding this comment.
That has a non-empty subver... "/Satoshi:22.0.0/"
There was a problem hiding this comment.
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)?
There was a problem hiding this comment.
It would have to be a very old or hacked/custom client. But showing "N/A" in that case seems wrong?
There was a problem hiding this comment.
"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.

During connection setup for a peer, getpeerinfo returns
"version": 0, "subver": ""and the GUI Peers window displays 0 and an empty field, respectively.Give these fields the same behavior as the other fields in the GUI Peers window: display the fallback value in
src/qt/forms/debugwindow.ui(i.e.N/A) until a valid result is available after the peer connection completes.An alternative would be to display nothing for both, as is the case currently for User Agent.