net: add GetMappedAS in CConnman

This commit is contained in:
brunoerg 2023-04-03 15:42:15 -03:00
parent 6b9fedd221
commit 9836c76ae0
2 changed files with 7 additions and 1 deletions

View File

@ -2598,6 +2598,11 @@ size_t CConnman::GetNodeCount(ConnectionDirection flags) const
return nNum;
}
uint32_t CConnman::GetMappedAS(const CNetAddr& addr) const
{
return m_netgroupman.GetMappedAS(addr);
}
void CConnman::GetNodeStats(std::vector<CNodeStats>& vstats) const
{
vstats.clear();
@ -2606,7 +2611,7 @@ void CConnman::GetNodeStats(std::vector<CNodeStats>& vstats) const
for (CNode* pnode : m_nodes) {
vstats.emplace_back();
pnode->CopyStats(vstats.back());
vstats.back().m_mapped_as = m_netgroupman.GetMappedAS(pnode->addr);
vstats.back().m_mapped_as = GetMappedAS(pnode->addr);
}
}

View File

@ -851,6 +851,7 @@ public:
bool AddConnection(const std::string& address, ConnectionType conn_type) EXCLUSIVE_LOCKS_REQUIRED(!m_unused_i2p_sessions_mutex);
size_t GetNodeCount(ConnectionDirection) const;
uint32_t GetMappedAS(const CNetAddr& addr) const;
void GetNodeStats(std::vector<CNodeStats>& vstats) const;
bool DisconnectNode(const std::string& node);
bool DisconnectNode(const CSubNet& subnet);