Skip to content

Commit a1d5a42

Browse files
committed
[net processing] Fix bad indentation in SendMessages()
Hint for reviewers: review ignoring whitespace changes.
1 parent 1a1c23f commit a1d5a42

File tree

1 file changed

+32
-32
lines changed

1 file changed

+32
-32
lines changed

src/net_processing.cpp

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -3839,41 +3839,41 @@ bool PeerLogicValidation::SendMessages(CNode* pto)
38393839
{
38403840
const Consensus::Params& consensusParams = Params().GetConsensus();
38413841

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;
38453845

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());
38483848

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));
38763875
}
3876+
}
38773877

38783878
{
38793879
LOCK(cs_main);

0 commit comments

Comments
 (0)