mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 15:09:59 +01:00
[net] Remove asmap argument from CNode::CopyStats()
This saves passing around a reference to the asmap std::vector<bool>.
This commit is contained in:
@@ -552,14 +552,13 @@ Network CNode::ConnectedThroughNetwork() const
|
||||
|
||||
#undef X
|
||||
#define X(name) stats.name = name
|
||||
void CNode::CopyStats(CNodeStats& stats, const std::vector<bool>& asmap)
|
||||
void CNode::CopyStats(CNodeStats& stats)
|
||||
{
|
||||
stats.nodeid = this->GetId();
|
||||
X(nServices);
|
||||
X(addr);
|
||||
X(addrBind);
|
||||
stats.m_network = ConnectedThroughNetwork();
|
||||
stats.m_mapped_as = addr.GetMappedAS(asmap);
|
||||
if (m_tx_relay != nullptr) {
|
||||
LOCK(m_tx_relay->cs_filter);
|
||||
stats.fRelayTxes = m_tx_relay->fRelayTxes;
|
||||
@@ -2804,7 +2803,8 @@ void CConnman::GetNodeStats(std::vector<CNodeStats>& vstats) const
|
||||
vstats.reserve(vNodes.size());
|
||||
for (CNode* pnode : vNodes) {
|
||||
vstats.emplace_back();
|
||||
pnode->CopyStats(vstats.back(), addrman.GetAsmap());
|
||||
pnode->CopyStats(vstats.back());
|
||||
vstats.back().m_mapped_as = pnode->addr.GetMappedAS(addrman.GetAsmap());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user