aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbrunoerg <brunoely.gc@gmail.com>2023-04-03 15:42:15 -0300
committerbrunoerg <brunoely.gc@gmail.com>2023-04-03 15:42:15 -0300
commit9836c76ae048698e4f7dab21e3be37313e8392ae (patch)
treeb672199c9d9dcd328367e289fe47100e67deee80 /src
parent6b9fedd2211851a70d2d82dea04420e9b87bfff9 (diff)
net: add `GetMappedAS` in `CConnman`
Diffstat (limited to 'src')
-rw-r--r--src/net.cpp7
-rw-r--r--src/net.h1
2 files changed, 7 insertions, 1 deletions
diff --git a/src/net.cpp b/src/net.cpp
index 7023cb0f49..d020fe9ea0 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -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);
}
}
diff --git a/src/net.h b/src/net.h
index 9b939aea5c..908b16f35e 100644
--- a/src/net.h
+++ b/src/net.h
@@ -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);