aboutsummaryrefslogtreecommitdiff
path: root/src/net.cpp
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2021-12-13 12:32:28 +0100
committerMarcoFalke <falke.marco@gmail.com>2021-12-13 13:32:08 +0100
commitfad943821e35d0eb2143061e718f0193e12a4c71 (patch)
tree48a01a43c66c7e0a523acdeab932f82ff35c959d /src/net.cpp
parentfa663a4c0d20487ed3f7a93e1c2ca9932b05f5a8 (diff)
downloadbitcoin-fad943821e35d0eb2143061e718f0193e12a4c71.tar.xz
scripted-diff: Rename touched member variables
-BEGIN VERIFY SCRIPT- ren() { sed -i "s/\<$1\>/$2/g" $( git grep -l "$1" ./src/ ) ; } ren nLastBlockTime m_last_block_time ren nLastTXTime m_last_tx_time ren nTimeConnected m_connected -END VERIFY SCRIPT-
Diffstat (limited to 'src/net.cpp')
-rw-r--r--src/net.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/net.cpp b/src/net.cpp
index af57d29e4d..cbf2ff3fa2 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -588,9 +588,9 @@ void CNode::CopyStats(CNodeStats& stats)
}
X(m_last_send);
X(m_last_recv);
- X(nLastTXTime);
- X(nLastBlockTime);
- X(nTimeConnected);
+ X(m_last_tx_time);
+ X(m_last_block_time);
+ X(m_connected);
X(nTimeOffset);
X(m_addr_name);
X(nVersion);
@@ -847,7 +847,7 @@ static bool ReverseCompareNodeMinPingTime(const NodeEvictionCandidate &a, const
static bool ReverseCompareNodeTimeConnected(const NodeEvictionCandidate &a, const NodeEvictionCandidate &b)
{
- return a.nTimeConnected > b.nTimeConnected;
+ return a.m_connected > b.m_connected;
}
static bool CompareNetGroupKeyed(const NodeEvictionCandidate &a, const NodeEvictionCandidate &b) {
@@ -857,27 +857,27 @@ static bool CompareNetGroupKeyed(const NodeEvictionCandidate &a, const NodeEvict
static bool CompareNodeBlockTime(const NodeEvictionCandidate &a, const NodeEvictionCandidate &b)
{
// There is a fall-through here because it is common for a node to have many peers which have not yet relayed a block.
- if (a.nLastBlockTime != b.nLastBlockTime) return a.nLastBlockTime < b.nLastBlockTime;
+ if (a.m_last_block_time != b.m_last_block_time) return a.m_last_block_time < b.m_last_block_time;
if (a.fRelevantServices != b.fRelevantServices) return b.fRelevantServices;
- return a.nTimeConnected > b.nTimeConnected;
+ return a.m_connected > b.m_connected;
}
static bool CompareNodeTXTime(const NodeEvictionCandidate &a, const NodeEvictionCandidate &b)
{
// 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.
- if (a.nLastTXTime != b.nLastTXTime) return a.nLastTXTime < b.nLastTXTime;
+ if (a.m_last_tx_time != b.m_last_tx_time) return a.m_last_tx_time < b.m_last_tx_time;
if (a.fRelayTxes != b.fRelayTxes) return b.fRelayTxes;
if (a.fBloomFilter != b.fBloomFilter) return a.fBloomFilter;
- return a.nTimeConnected > b.nTimeConnected;
+ return a.m_connected > b.m_connected;
}
// Pick out the potential block-relay only peers, and sort them by last block time.
static bool CompareNodeBlockRelayOnlyTime(const NodeEvictionCandidate &a, const NodeEvictionCandidate &b)
{
if (a.fRelayTxes != b.fRelayTxes) return a.fRelayTxes;
- if (a.nLastBlockTime != b.nLastBlockTime) return a.nLastBlockTime < b.nLastBlockTime;
+ if (a.m_last_block_time != b.m_last_block_time) return a.m_last_block_time < b.m_last_block_time;
if (a.fRelevantServices != b.fRelevantServices) return b.fRelevantServices;
- return a.nTimeConnected > b.nTimeConnected;
+ return a.m_connected > b.m_connected;
}
/**
@@ -896,7 +896,7 @@ struct CompareNodeNetworkTime {
{
if (m_is_local && a.m_is_local != b.m_is_local) return b.m_is_local;
if ((a.m_network == m_network) != (b.m_network == m_network)) return b.m_network == m_network;
- return a.nTimeConnected > b.nTimeConnected;
+ return a.m_connected > b.m_connected;
};
};
@@ -1028,7 +1028,7 @@ void ProtectEvictionCandidatesByRatio(std::vector<NodeEvictionCandidate>& evicti
for (const NodeEvictionCandidate &node : vEvictionCandidates) {
std::vector<NodeEvictionCandidate> &group = mapNetGroupNodes[node.nKeyedNetGroup];
group.push_back(node);
- const auto grouptime{group[0].nTimeConnected};
+ const auto grouptime{group[0].m_connected};
if (group.size() > nMostConnections || (group.size() == nMostConnections && grouptime > nMostConnectionsTime)) {
nMostConnections = group.size();
@@ -1072,8 +1072,8 @@ bool CConnman::AttemptToEvictConnection()
peer_relay_txes = node->m_tx_relay->fRelayTxes;
peer_filter_not_null = node->m_tx_relay->pfilter != nullptr;
}
- NodeEvictionCandidate candidate = {node->GetId(), node->nTimeConnected, node->m_min_ping_time,
- node->nLastBlockTime, node->nLastTXTime,
+ NodeEvictionCandidate candidate = {node->GetId(), node->m_connected, node->m_min_ping_time,
+ node->m_last_block_time, node->m_last_tx_time,
HasAllDesirableServiceFlags(node->nServices),
peer_relay_txes, peer_filter_not_null, node->nKeyedNetGroup,
node->m_prefer_evict, node->addr.IsLocal(),
@@ -1320,7 +1320,7 @@ void CConnman::NotifyNumConnectionsChanged()
bool CConnman::ShouldRunInactivityChecks(const CNode& node, std::chrono::seconds now) const
{
- return node.nTimeConnected + m_peer_connect_timeout < now;
+ return node.m_connected + m_peer_connect_timeout < now;
}
bool CConnman::InactivityCheck(const CNode& node) const
@@ -2975,7 +2975,7 @@ ServiceFlags CConnman::GetLocalServices() const
unsigned int CConnman::GetReceiveFloodSize() const { return nReceiveFloodSize; }
CNode::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)
- : nTimeConnected{GetTime<std::chrono::seconds>()},
+ : m_connected{GetTime<std::chrono::seconds>()},
addr(addrIn),
addrBind(addrBindIn),
m_addr_name{addrNameIn.empty() ? addr.ToStringIPPort() : addrNameIn},