@@ -3839,41 +3839,41 @@ bool PeerLogicValidation::SendMessages(CNode* pto)
3839
3839
{
3840
3840
const Consensus::Params& consensusParams = Params ().GetConsensus ();
3841
3841
3842
- // Don't send anything until the version handshake is complete
3843
- if (!pto->fSuccessfullyConnected || pto->fDisconnect )
3844
- return true ;
3842
+ // Don't send anything until the version handshake is complete
3843
+ if (!pto->fSuccessfullyConnected || pto->fDisconnect )
3844
+ return true ;
3845
3845
3846
- // If we get here, the outgoing message serialization version is set and can't change.
3847
- const CNetMsgMaker msgMaker (pto->GetSendVersion ());
3846
+ // If we get here, the outgoing message serialization version is set and can't change.
3847
+ const CNetMsgMaker msgMaker (pto->GetSendVersion ());
3848
3848
3849
- //
3850
- // Message: ping
3851
- //
3852
- bool pingSend = false ;
3853
- if (pto->fPingQueued ) {
3854
- // RPC ping request by user
3855
- pingSend = true ;
3856
- }
3857
- if (pto->nPingNonceSent == 0 && pto->m_ping_start .load () + PING_INTERVAL < GetTime<std::chrono::microseconds>()) {
3858
- // Ping automatically sent as a latency probe & keepalive.
3859
- pingSend = true ;
3860
- }
3861
- if (pingSend) {
3862
- uint64_t nonce = 0 ;
3863
- while (nonce == 0 ) {
3864
- GetRandBytes ((unsigned char *)&nonce, sizeof (nonce));
3865
- }
3866
- pto->fPingQueued = false ;
3867
- pto->m_ping_start = GetTime<std::chrono::microseconds>();
3868
- if (pto->nVersion > BIP0031_VERSION) {
3869
- pto->nPingNonceSent = nonce;
3870
- connman->PushMessage (pto, msgMaker.Make (NetMsgType::PING, nonce));
3871
- } else {
3872
- // Peer is too old to support ping command with nonce, pong will never arrive.
3873
- pto->nPingNonceSent = 0 ;
3874
- connman->PushMessage (pto, msgMaker.Make (NetMsgType::PING));
3875
- }
3849
+ //
3850
+ // Message: ping
3851
+ //
3852
+ bool pingSend = false ;
3853
+ if (pto->fPingQueued ) {
3854
+ // RPC ping request by user
3855
+ pingSend = true ;
3856
+ }
3857
+ if (pto->nPingNonceSent == 0 && pto->m_ping_start .load () + PING_INTERVAL < GetTime<std::chrono::microseconds>()) {
3858
+ // Ping automatically sent as a latency probe & keepalive.
3859
+ pingSend = true ;
3860
+ }
3861
+ if (pingSend) {
3862
+ uint64_t nonce = 0 ;
3863
+ while (nonce == 0 ) {
3864
+ GetRandBytes ((unsigned char *)&nonce, sizeof (nonce));
3865
+ }
3866
+ pto->fPingQueued = false ;
3867
+ pto->m_ping_start = GetTime<std::chrono::microseconds>();
3868
+ if (pto->nVersion > BIP0031_VERSION) {
3869
+ pto->nPingNonceSent = nonce;
3870
+ connman->PushMessage (pto, msgMaker.Make (NetMsgType::PING, nonce));
3871
+ } else {
3872
+ // Peer is too old to support ping command with nonce, pong will never arrive.
3873
+ pto->nPingNonceSent = 0 ;
3874
+ connman->PushMessage (pto, msgMaker.Make (NetMsgType::PING));
3876
3875
}
3876
+ }
3877
3877
3878
3878
{
3879
3879
LOCK (cs_main);
0 commit comments