From f9002cb5dbd573cd9ca200de21319fa296e26055 Mon Sep 17 00:00:00 2001 From: John Newbery Date: Tue, 24 Aug 2021 11:40:21 +0100 Subject: [PATCH] [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. --- src/net.cpp | 6 +++--- src/net.h | 2 +- src/test/fuzz/net.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/net.cpp b/src/net.cpp index 57b8844d6bf..65544352ee7 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -567,14 +567,14 @@ Network CNode::ConnectedThroughNetwork() const #undef X #define X(name) stats.name = name -void CNode::copyStats(CNodeStats &stats, const std::vector &m_asmap) +void CNode::CopyStats(CNodeStats& stats, const std::vector& asmap) { stats.nodeid = this->GetId(); X(nServices); X(addr); X(addrBind); stats.m_network = ConnectedThroughNetwork(); - stats.m_mapped_as = addr.GetMappedAS(m_asmap); + stats.m_mapped_as = addr.GetMappedAS(asmap); if (m_tx_relay != nullptr) { LOCK(m_tx_relay->cs_filter); stats.fRelayTxes = m_tx_relay->fRelayTxes; @@ -2819,7 +2819,7 @@ void CConnman::GetNodeStats(std::vector& vstats) const vstats.reserve(vNodes.size()); for (CNode* pnode : vNodes) { vstats.emplace_back(); - pnode->copyStats(vstats.back(), addrman.m_asmap); + pnode->CopyStats(vstats.back(), addrman.m_asmap); } } diff --git a/src/net.h b/src/net.h index 316425e6779..2d9c29a05e9 100644 --- a/src/net.h +++ b/src/net.h @@ -651,7 +651,7 @@ public: void CloseSocketDisconnect(); - void copyStats(CNodeStats &stats, const std::vector &m_asmap); + void CopyStats(CNodeStats& stats, const std::vector& asmap); ServiceFlags GetLocalServices() const { diff --git a/src/test/fuzz/net.cpp b/src/test/fuzz/net.cpp index 20d85813128..e00b5b09bfe 100644 --- a/src/test/fuzz/net.cpp +++ b/src/test/fuzz/net.cpp @@ -46,7 +46,7 @@ FUZZ_TARGET_INIT(net, initialize_net) return; } CNodeStats stats; - node.copyStats(stats, asmap); + node.CopyStats(stats, asmap); }, [&] { const CNode* add_ref_node = node.AddRef();