@@ -588,9 +588,9 @@ void CNode::CopyStats(CNodeStats& stats)
588588 }
589589 X (m_last_send);
590590 X (m_last_recv);
591- X (nLastTXTime );
592- X (nLastBlockTime );
593- X (nTimeConnected );
591+ X (m_last_tx_time );
592+ X (m_last_block_time );
593+ X (m_connected );
594594 X (nTimeOffset);
595595 X (m_addr_name);
596596 X (nVersion);
@@ -847,7 +847,7 @@ static bool ReverseCompareNodeMinPingTime(const NodeEvictionCandidate &a, const
847847
848848static bool ReverseCompareNodeTimeConnected (const NodeEvictionCandidate &a, const NodeEvictionCandidate &b)
849849{
850- return a.nTimeConnected > b.nTimeConnected ;
850+ return a.m_connected > b.m_connected ;
851851}
852852
853853static bool CompareNetGroupKeyed (const NodeEvictionCandidate &a, const NodeEvictionCandidate &b) {
@@ -857,27 +857,27 @@ static bool CompareNetGroupKeyed(const NodeEvictionCandidate &a, const NodeEvict
857857static bool CompareNodeBlockTime (const NodeEvictionCandidate &a, const NodeEvictionCandidate &b)
858858{
859859 // There is a fall-through here because it is common for a node to have many peers which have not yet relayed a block.
860- if (a.nLastBlockTime != b.nLastBlockTime ) return a.nLastBlockTime < b.nLastBlockTime ;
860+ if (a.m_last_block_time != b.m_last_block_time ) return a.m_last_block_time < b.m_last_block_time ;
861861 if (a.fRelevantServices != b.fRelevantServices ) return b.fRelevantServices ;
862- return a.nTimeConnected > b.nTimeConnected ;
862+ return a.m_connected > b.m_connected ;
863863}
864864
865865static bool CompareNodeTXTime (const NodeEvictionCandidate &a, const NodeEvictionCandidate &b)
866866{
867867 // There is a fall-through here because it is common for a node to have more than a few peers that have not yet relayed txn.
868- if (a.nLastTXTime != b.nLastTXTime ) return a.nLastTXTime < b.nLastTXTime ;
868+ if (a.m_last_tx_time != b.m_last_tx_time ) return a.m_last_tx_time < b.m_last_tx_time ;
869869 if (a.fRelayTxes != b.fRelayTxes ) return b.fRelayTxes ;
870870 if (a.fBloomFilter != b.fBloomFilter ) return a.fBloomFilter ;
871- return a.nTimeConnected > b.nTimeConnected ;
871+ return a.m_connected > b.m_connected ;
872872}
873873
874874// Pick out the potential block-relay only peers, and sort them by last block time.
875875static bool CompareNodeBlockRelayOnlyTime (const NodeEvictionCandidate &a, const NodeEvictionCandidate &b)
876876{
877877 if (a.fRelayTxes != b.fRelayTxes ) return a.fRelayTxes ;
878- if (a.nLastBlockTime != b.nLastBlockTime ) return a.nLastBlockTime < b.nLastBlockTime ;
878+ if (a.m_last_block_time != b.m_last_block_time ) return a.m_last_block_time < b.m_last_block_time ;
879879 if (a.fRelevantServices != b.fRelevantServices ) return b.fRelevantServices ;
880- return a.nTimeConnected > b.nTimeConnected ;
880+ return a.m_connected > b.m_connected ;
881881}
882882
883883/* *
@@ -896,7 +896,7 @@ struct CompareNodeNetworkTime {
896896 {
897897 if (m_is_local && a.m_is_local != b.m_is_local ) return b.m_is_local ;
898898 if ((a.m_network == m_network) != (b.m_network == m_network)) return b.m_network == m_network;
899- return a.nTimeConnected > b.nTimeConnected ;
899+ return a.m_connected > b.m_connected ;
900900 };
901901};
902902
@@ -1028,7 +1028,7 @@ void ProtectEvictionCandidatesByRatio(std::vector<NodeEvictionCandidate>& evicti
10281028 for (const NodeEvictionCandidate &node : vEvictionCandidates) {
10291029 std::vector<NodeEvictionCandidate> &group = mapNetGroupNodes[node.nKeyedNetGroup ];
10301030 group.push_back (node);
1031- const auto grouptime{group[0 ].nTimeConnected };
1031+ const auto grouptime{group[0 ].m_connected };
10321032
10331033 if (group.size () > nMostConnections || (group.size () == nMostConnections && grouptime > nMostConnectionsTime)) {
10341034 nMostConnections = group.size ();
@@ -1072,8 +1072,8 @@ bool CConnman::AttemptToEvictConnection()
10721072 peer_relay_txes = node->m_tx_relay ->fRelayTxes ;
10731073 peer_filter_not_null = node->m_tx_relay ->pfilter != nullptr ;
10741074 }
1075- NodeEvictionCandidate candidate = {node->GetId (), node->nTimeConnected , node->m_min_ping_time ,
1076- node->nLastBlockTime , node->nLastTXTime ,
1075+ NodeEvictionCandidate candidate = {node->GetId (), node->m_connected , node->m_min_ping_time ,
1076+ node->m_last_block_time , node->m_last_tx_time ,
10771077 HasAllDesirableServiceFlags (node->nServices ),
10781078 peer_relay_txes, peer_filter_not_null, node->nKeyedNetGroup ,
10791079 node->m_prefer_evict , node->addr .IsLocal (),
@@ -1320,7 +1320,7 @@ void CConnman::NotifyNumConnectionsChanged()
13201320
13211321bool CConnman::ShouldRunInactivityChecks (const CNode& node, std::chrono::seconds now) const
13221322{
1323- return node.nTimeConnected + m_peer_connect_timeout < now;
1323+ return node.m_connected + m_peer_connect_timeout < now;
13241324}
13251325
13261326bool CConnman::InactivityCheck (const CNode& node) const
@@ -2975,7 +2975,7 @@ ServiceFlags CConnman::GetLocalServices() const
29752975unsigned int CConnman::GetReceiveFloodSize () const { return nReceiveFloodSize; }
29762976
29772977CNode::CNode (NodeId idIn, ServiceFlags nLocalServicesIn, SOCKET hSocketIn, const CAddress& addrIn, uint64_t nKeyedNetGroupIn, uint64_t nLocalHostNonceIn, const CAddress& addrBindIn, const std::string& addrNameIn, ConnectionType conn_type_in, bool inbound_onion)
2978- : nTimeConnected {GetTime<std::chrono::seconds>()},
2978+ : m_connected {GetTime<std::chrono::seconds>()},
29792979 addr (addrIn),
29802980 addrBind(addrBindIn),
29812981 m_addr_name{addrNameIn.empty () ? addr.ToStringIPPort () : addrNameIn},
0 commit comments