diff options
author | Pieter Wuille <pieter@wuille.net> | 2020-06-08 18:46:53 -0700 |
---|---|---|
committer | Pieter Wuille <pieter@wuille.net> | 2020-07-03 20:43:55 -0700 |
commit | b691f2df5f7d443c0c9ee056ab94aa0fc19566d5 (patch) | |
tree | 00f4cdae9cd0ea068634de9d910229123e7e7847 /src/netaddress.h | |
parent | 3276c148c4cac7b7c9adbaab5997b26488612085 (diff) |
Replace automatic bans with discouragement filter
This patch improves performance and resource usage around IP
addresses that are banned for misbehavior. They're already not
actually banned, as connections from them are still allowed,
but they are preferred for eviction if the inbound connection
slots are full.
Stop treating these like manually banned IP ranges, and instead
just keep them in a rolling Bloom filter of misbehaving nodes,
which isn't persisted to disk or exposed through the ban
framework. The effect remains the same: preferred for eviction,
avoided for outgoing connections, and not relayed to other peers.
Also change the name of this mechanism to better reflect reality;
they're not banned, just discouraged.
Contains release notes and several interface improvements by
John Newbery.
Diffstat (limited to 'src/netaddress.h')
-rw-r--r-- | src/netaddress.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/netaddress.h b/src/netaddress.h index e640c07d32..552abc4119 100644 --- a/src/netaddress.h +++ b/src/netaddress.h @@ -90,6 +90,7 @@ class CNetAddr uint32_t GetMappedAS(const std::vector<bool> &asmap) const; std::vector<unsigned char> GetGroup(const std::vector<bool> &asmap) const; + std::vector<unsigned char> GetAddrBytes() const { return {std::begin(ip), std::end(ip)}; } int GetReachabilityFrom(const CNetAddr *paddrPartner = nullptr) const; explicit CNetAddr(const struct in6_addr& pipv6Addr, const uint32_t scope = 0); |