aboutsummaryrefslogtreecommitdiff
path: root/src/net.cpp
diff options
context:
space:
mode:
authorGleb Naumenko <naumenko.gs@gmail.com>2019-12-24 13:26:46 -0500
committerGleb Naumenko <naumenko.gs@gmail.com>2020-01-23 14:22:56 -0500
commite4658aa8eaf1629dd5af8cf7b9717a8e72028251 (patch)
tree1f2ba6f5bfca20d4780d23fb074bdb449796327f /src/net.cpp
parentec45646de9e62b3d42c85716bfeb06d8f2b507dc (diff)
Return mapped AS in RPC call getpeerinfo
If ASN bucketing is used, return a corresponding AS used in bucketing for a given peer.
Diffstat (limited to 'src/net.cpp')
-rw-r--r--src/net.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/net.cpp b/src/net.cpp
index 004f1de583..8068c4010a 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -493,12 +493,13 @@ void CNode::SetAddrLocal(const CService& addrLocalIn) {
#undef X
#define X(name) stats.name = name
-void CNode::copyStats(CNodeStats &stats)
+void CNode::copyStats(CNodeStats &stats, std::vector<bool> &m_asmap)
{
stats.nodeid = this->GetId();
X(nServices);
X(addr);
X(addrBind);
+ stats.m_mapped_as = addr.GetMappedAS(m_asmap);
if (m_tx_relay != nullptr) {
LOCK(m_tx_relay->cs_filter);
stats.fRelayTxes = m_tx_relay->fRelayTxes;
@@ -2491,7 +2492,7 @@ void CConnman::GetNodeStats(std::vector<CNodeStats>& vstats)
vstats.reserve(vNodes.size());
for (CNode* pnode : vNodes) {
vstats.emplace_back();
- pnode->copyStats(vstats.back());
+ pnode->copyStats(vstats.back(), addrman.m_asmap);
}
}