[net] Rename the copyStats arg from m_asmap to asmap

The m_ prefix indicates that a variable is a data member. Using it as
a parameter name is misleading.

Also update the name of the function from copyStats to CopyStats to
comply with our style guide.
This commit is contained in:
John Newbery 2021-08-24 11:40:21 +01:00
parent f572f2b204
commit f9002cb5db
3 changed files with 5 additions and 5 deletions

View file

@ -567,14 +567,14 @@ Network CNode::ConnectedThroughNetwork() const
#undef X #undef X
#define X(name) stats.name = name #define X(name) stats.name = name
void CNode::copyStats(CNodeStats &stats, const std::vector<bool> &m_asmap) void CNode::CopyStats(CNodeStats& stats, const std::vector<bool>& asmap)
{ {
stats.nodeid = this->GetId(); stats.nodeid = this->GetId();
X(nServices); X(nServices);
X(addr); X(addr);
X(addrBind); X(addrBind);
stats.m_network = ConnectedThroughNetwork(); stats.m_network = ConnectedThroughNetwork();
stats.m_mapped_as = addr.GetMappedAS(m_asmap); stats.m_mapped_as = addr.GetMappedAS(asmap);
if (m_tx_relay != nullptr) { if (m_tx_relay != nullptr) {
LOCK(m_tx_relay->cs_filter); LOCK(m_tx_relay->cs_filter);
stats.fRelayTxes = m_tx_relay->fRelayTxes; stats.fRelayTxes = m_tx_relay->fRelayTxes;
@ -2819,7 +2819,7 @@ void CConnman::GetNodeStats(std::vector<CNodeStats>& vstats) const
vstats.reserve(vNodes.size()); vstats.reserve(vNodes.size());
for (CNode* pnode : vNodes) { for (CNode* pnode : vNodes) {
vstats.emplace_back(); vstats.emplace_back();
pnode->copyStats(vstats.back(), addrman.m_asmap); pnode->CopyStats(vstats.back(), addrman.m_asmap);
} }
} }

View file

@ -651,7 +651,7 @@ public:
void CloseSocketDisconnect(); void CloseSocketDisconnect();
void copyStats(CNodeStats &stats, const std::vector<bool> &m_asmap); void CopyStats(CNodeStats& stats, const std::vector<bool>& asmap);
ServiceFlags GetLocalServices() const ServiceFlags GetLocalServices() const
{ {

View file

@ -46,7 +46,7 @@ FUZZ_TARGET_INIT(net, initialize_net)
return; return;
} }
CNodeStats stats; CNodeStats stats;
node.copyStats(stats, asmap); node.CopyStats(stats, asmap);
}, },
[&] { [&] {
const CNode* add_ref_node = node.AddRef(); const CNode* add_ref_node = node.AddRef();