mirror of
https://github.com/bitcoin/bitcoin.git
synced 2024-11-20 02:25:40 +01:00
net: add GetMappedAS
in CConnman
This commit is contained in:
parent
6b9fedd221
commit
9836c76ae0
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user