Skip to content

Commit 9836c76

Browse files
committed
net: add GetMappedAS in CConnman
1 parent 6b9fedd commit 9836c76

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/net.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2598,6 +2598,11 @@ size_t CConnman::GetNodeCount(ConnectionDirection flags) const
25982598
return nNum;
25992599
}
26002600

2601+
uint32_t CConnman::GetMappedAS(const CNetAddr& addr) const
2602+
{
2603+
return m_netgroupman.GetMappedAS(addr);
2604+
}
2605+
26012606
void CConnman::GetNodeStats(std::vector<CNodeStats>& vstats) const
26022607
{
26032608
vstats.clear();
@@ -2606,7 +2611,7 @@ void CConnman::GetNodeStats(std::vector<CNodeStats>& vstats) const
26062611
for (CNode* pnode : m_nodes) {
26072612
vstats.emplace_back();
26082613
pnode->CopyStats(vstats.back());
2609-
vstats.back().m_mapped_as = m_netgroupman.GetMappedAS(pnode->addr);
2614+
vstats.back().m_mapped_as = GetMappedAS(pnode->addr);
26102615
}
26112616
}
26122617

src/net.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -851,6 +851,7 @@ class CConnman
851851
bool AddConnection(const std::string& address, ConnectionType conn_type) EXCLUSIVE_LOCKS_REQUIRED(!m_unused_i2p_sessions_mutex);
852852

853853
size_t GetNodeCount(ConnectionDirection) const;
854+
uint32_t GetMappedAS(const CNetAddr& addr) const;
854855
void GetNodeStats(std::vector<CNodeStats>& vstats) const;
855856
bool DisconnectNode(const std::string& node);
856857
bool DisconnectNode(const CSubNet& subnet);

0 commit comments

Comments
 (0)