ping doesn't return anything so what is it used for?
If a user wants to ping and check ping time for all peers,
getpeerinfo can be used.
Bitcoin Stack Exchange is a question and answer site for Bitcoin crypto-currency enthusiasts. It only takes a minute to sign up.Sign up to join this community
The help text is your friend:
Requests that a ping be sent to all other nodes, to measure ping time. Results provided in getpeerinfo, pingtime and pingwait fields are decimal seconds. Ping command is handled in queue with all other commands, so it measures processing backlog, not just network ping
After you use
ping, you may see a new field,
pingwait, in the
getpeerinfo output. This is the time for waiting for the ping response. You will also see
pingtime being updated once the peer responds to the ping. The purpose is to get an update on the ping times since the ping time reported may have been measured a long time ago.