From e4658aa8eaf1629dd5af8cf7b9717a8e72028251 Mon Sep 17 00:00:00 2001 From: Gleb Naumenko Date: Tue, 24 Dec 2019 13:26:46 -0500 Subject: Return mapped AS in RPC call getpeerinfo If ASN bucketing is used, return a corresponding AS used in bucketing for a given peer. --- src/netaddress.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/netaddress.h') diff --git a/src/netaddress.h b/src/netaddress.h index b1a6054e48..e03a88db94 100644 --- a/src/netaddress.h +++ b/src/netaddress.h @@ -78,8 +78,14 @@ class CNetAddr unsigned int GetByte(int n) const; uint64_t GetHash() const; bool GetInAddr(struct in_addr* pipv4Addr) const; - std::vector GetGroup(const std::vector &asmap) const; + uint32_t GetNetClass() const; + + // The AS on the BGP path to the node we use to diversify + // peers in AddrMan bucketing based on the AS infrastructure. + // The ip->AS mapping depends on how asmap is constructed. + uint32_t GetMappedAS(const std::vector &asmap) const; + std::vector GetGroup(const std::vector &asmap) const; int GetReachabilityFrom(const CNetAddr *paddrPartner = nullptr) const; explicit CNetAddr(const struct in6_addr& pipv6Addr, const uint32_t scope = 0); -- cgit v1.2.3