aboutsummaryrefslogtreecommitdiff
path: root/src/netaddress.h
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/netaddress.h
parentec45646de9e62b3d42c85716bfeb06d8f2b507dc (diff)
downloadbitcoin-e4658aa8eaf1629dd5af8cf7b9717a8e72028251.tar.xz
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/netaddress.h')
-rw-r--r--src/netaddress.h8
1 files changed, 7 insertions, 1 deletions
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<unsigned char> GetGroup(const std::vector<bool> &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<bool> &asmap) const;
+ std::vector<unsigned char> GetGroup(const std::vector<bool> &asmap) const;
int GetReachabilityFrom(const CNetAddr *paddrPartner = nullptr) const;
explicit CNetAddr(const struct in6_addr& pipv6Addr, const uint32_t scope = 0);