aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
diff options
context:
space:
mode:
authorJon Atack <jon@atack.com>2022-01-26 09:01:42 +0100
committerJon Atack <jon@atack.com>2022-01-26 09:19:23 +0100
commitf7b8094d611531c6b41a94715dbc01f56257ccd2 (patch)
tree371e4619fd9dad8f1d7c86349370f6a5a59ed168 /src/net.h
parentdd405add6ecff44bde3924ff7bfa4719b36f3596 (diff)
downloadbitcoin-f7b8094d611531c6b41a94715dbc01f56257ccd2.tar.xz
p2p: extend inbound eviction protection by network to CJDNS peers
This commit extends our inbound eviction protection to CJDNS peers to favorise the diversity of peer connections, as peers connected through the CJDNS network are otherwise disadvantaged by our eviction criteria for their higher latency (higher min ping times) relative to IPv4 and IPv6 peers. The `networks` array is order-dependent in the case of a tie in candidate counts between networks; earlier array members receive priority in the case of a tie. Therefore, we place CJDNS candidates before I2P, localhost, and onion ones in terms of opportunity to recover unused remaining protected slots from the previous iteration, estimating that most nodes allowing several inbound privacy networks will have more onion, localhost or I2P peers than CJDNS ones, as CJDNS support is only being added in the upcoming v23.0 release.
Diffstat (limited to 'src/net.h')
-rw-r--r--src/net.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/net.h b/src/net.h
index 4301733525..74a18a6803 100644
--- a/src/net.h
+++ b/src/net.h
@@ -1307,6 +1307,8 @@ struct NodeEvictionCandidate
*
* - I2P peers
*
+ * - CJDNS peers
+ *
* This helps protect these privacy network peers, which tend to be otherwise
* disadvantaged under our eviction criteria for their higher min ping times
* relative to IPv4/IPv6 peers, and favorise the diversity of peer connections.