diff options
| author | Gleb Naumenko <[email protected]> | 2019-12-24 13:26:46 -0500 |
|---|---|---|
| committer | Gleb Naumenko <[email protected]> | 2020-01-23 14:22:56 -0500 |
| commit | e4658aa8eaf1629dd5af8cf7b9717a8e72028251 (patch) | |
| tree | 1f2ba6f5bfca20d4780d23fb074bdb449796327f /src/netaddress.h | |
| parent | Integrate ASN bucketing in Addrman and add tests (diff) | |
| download | discoin-e4658aa8eaf1629dd5af8cf7b9717a8e72028251.tar.xz discoin-e4658aa8eaf1629dd5af8cf7b9717a8e72028251.zip | |
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.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/netaddress.h b/src/netaddress.h index b1a6054e4..e03a88db9 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); |