@@ -220,11 +220,11 @@ struct Peer {
220
220
std::atomic<int > m_starting_height{-1 };
221
221
222
222
/* * The pong reply we're expecting, or 0 if no pong expected. */
223
- std::atomic<uint64_t > nPingNonceSent {0 };
223
+ std::atomic<uint64_t > m_ping_nonce_sent {0 };
224
224
/* * When the last ping was sent, or 0 if no ping was ever sent */
225
225
std::atomic<std::chrono::microseconds> m_ping_start{0us};
226
226
/* * Whether a ping has been requested by the user */
227
- std::atomic<bool > fPingQueued {false };
227
+ std::atomic<bool > m_ping_queued {false };
228
228
229
229
/* * Set of txids to reconsider once their parent transactions have been accepted **/
230
230
std::set<uint256> m_orphan_work_set GUARDED_BY (g_cs_orphans);
@@ -1108,7 +1108,7 @@ bool PeerManagerImpl::GetNodeStateStats(NodeId nodeid, CNodeStateStats &stats)
1108
1108
// So, if a ping is taking an unusually long time in flight,
1109
1109
// the caller can immediately detect that this is happening.
1110
1110
std::chrono::microseconds ping_wait{0 };
1111
- if ((0 != peer->nPingNonceSent ) && (0 != peer->m_ping_start .load ().count ())) {
1111
+ if ((0 != peer->m_ping_nonce_sent ) && (0 != peer->m_ping_start .load ().count ())) {
1112
1112
ping_wait = GetTime<std::chrono::microseconds>() - peer->m_ping_start .load ();
1113
1113
}
1114
1114
@@ -1655,7 +1655,7 @@ bool static AlreadyHaveBlock(const uint256& block_hash) EXCLUSIVE_LOCKS_REQUIRED
1655
1655
void PeerManagerImpl::SendPings ()
1656
1656
{
1657
1657
LOCK (m_peer_mutex);
1658
- for (auto & it : m_peer_map) it.second ->fPingQueued = true ;
1658
+ for (auto & it : m_peer_map) it.second ->m_ping_queued = true ;
1659
1659
}
1660
1660
1661
1661
void RelayTransaction (const uint256& txid, const uint256& wtxid, const CConnman& connman)
@@ -3868,8 +3868,8 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
3868
3868
vRecv >> nonce;
3869
3869
3870
3870
// Only process pong message if there is an outstanding ping (old ping without nonce should never pong)
3871
- if (peer->nPingNonceSent != 0 ) {
3872
- if (nonce == peer->nPingNonceSent ) {
3871
+ if (peer->m_ping_nonce_sent != 0 ) {
3872
+ if (nonce == peer->m_ping_nonce_sent ) {
3873
3873
// Matching pong received, this ping is no longer outstanding
3874
3874
bPingFinished = true ;
3875
3875
const auto ping_time = ping_end - peer->m_ping_start .load ();
@@ -3902,12 +3902,12 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
3902
3902
LogPrint (BCLog::NET, " pong peer=%d: %s, %x expected, %x received, %u bytes\n " ,
3903
3903
pfrom.GetId (),
3904
3904
sProblem ,
3905
- peer->nPingNonceSent ,
3905
+ peer->m_ping_nonce_sent ,
3906
3906
nonce,
3907
3907
nAvail);
3908
3908
}
3909
3909
if (bPingFinished) {
3910
- peer->nPingNonceSent = 0 ;
3910
+ peer->m_ping_nonce_sent = 0 ;
3911
3911
}
3912
3912
return ;
3913
3913
}
@@ -4327,7 +4327,7 @@ void PeerManagerImpl::MaybeSendPing(CNode& node_to, Peer& peer)
4327
4327
// This means that setmocktime may cause pings to time out.
4328
4328
auto now = GetTime<std::chrono::microseconds>();
4329
4329
4330
- if (m_connman.RunInactivityChecks (node_to) && peer.nPingNonceSent &&
4330
+ if (m_connman.RunInactivityChecks (node_to) && peer.m_ping_nonce_sent &&
4331
4331
now > peer.m_ping_start .load () + std::chrono::seconds{TIMEOUT_INTERVAL}) {
4332
4332
LogPrint (BCLog::NET, " ping timeout: %fs peer=%d\n " , 0.000001 * count_microseconds (now - peer.m_ping_start .load ()), peer.m_id );
4333
4333
node_to.fDisconnect = true ;
@@ -4337,12 +4337,12 @@ void PeerManagerImpl::MaybeSendPing(CNode& node_to, Peer& peer)
4337
4337
const CNetMsgMaker msgMaker (node_to.GetCommonVersion ());
4338
4338
bool pingSend = false ;
4339
4339
4340
- if (peer.fPingQueued ) {
4340
+ if (peer.m_ping_queued ) {
4341
4341
// RPC ping request by user
4342
4342
pingSend = true ;
4343
4343
}
4344
4344
4345
- if (peer.nPingNonceSent == 0 && now > peer.m_ping_start .load () + PING_INTERVAL) {
4345
+ if (peer.m_ping_nonce_sent == 0 && now > peer.m_ping_start .load () + PING_INTERVAL) {
4346
4346
// Ping automatically sent as a latency probe & keepalive.
4347
4347
pingSend = true ;
4348
4348
}
@@ -4352,14 +4352,14 @@ void PeerManagerImpl::MaybeSendPing(CNode& node_to, Peer& peer)
4352
4352
while (nonce == 0 ) {
4353
4353
GetRandBytes ((unsigned char *)&nonce, sizeof (nonce));
4354
4354
}
4355
- peer.fPingQueued = false ;
4355
+ peer.m_ping_queued = false ;
4356
4356
peer.m_ping_start = now;
4357
4357
if (node_to.GetCommonVersion () > BIP0031_VERSION) {
4358
- peer.nPingNonceSent = nonce;
4358
+ peer.m_ping_nonce_sent = nonce;
4359
4359
m_connman.PushMessage (&node_to, msgMaker.Make (NetMsgType::PING, nonce));
4360
4360
} else {
4361
4361
// Peer is too old to support ping command with nonce, pong will never arrive.
4362
- peer.nPingNonceSent = 0 ;
4362
+ peer.m_ping_nonce_sent = 0 ;
4363
4363
m_connman.PushMessage (&node_to, msgMaker.Make (NetMsgType::PING));
4364
4364
}
4365
4365
}
0 commit comments