Skip to content

Commit 787d46b

Browse files
committed
p2p: update ProtectEvictionCandidatesByRatio() doxygen docs
1 parent 1e15acf commit 787d46b

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

src/net.h

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1228,20 +1228,18 @@ struct NodeEvictionCandidate
12281228
* longest, to replicate the non-eviction implicit behavior and preclude attacks
12291229
* that start later.
12301230
*
1231-
* Half of these protected spots (1/4 of the total) are reserved for onion peers
1232-
* connected via our tor control service, if any, sorted by longest uptime, even
1233-
* if they're not longest uptime overall. Any remaining slots of the 1/4 are
1234-
* then allocated to protect localhost peers, if any (or up to 2 localhost peers
1235-
* if no slots remain and 2 or more onion peers were protected), sorted by
1236-
* longest uptime, as manually configured hidden services not using
1237-
* `-bind=addr[:port]=onion` will not be detected as inbound onion connections.
1231+
* Half of these protected spots (1/4 of the total) are reserved for the
1232+
* following categories of peers, sorted by longest uptime, even if they're not
1233+
* longest uptime overall:
12381234
*
1239-
* This helps protect onion peers, which tend to be otherwise disadvantaged
1240-
* under our eviction criteria for their higher min ping times relative to IPv4
1241-
* and IPv6 peers, and favorise the diversity of peer connections.
1235+
* - onion peers connected via our tor control service
12421236
*
1243-
* This function was extracted from SelectNodeToEvict() to be able to test the
1244-
* ratio-based protection logic deterministically.
1237+
* - localhost peers, as manually configured hidden services not using
1238+
* `-bind=addr[:port]=onion` will not be detected as inbound onion connections
1239+
*
1240+
* This helps protect these privacy network peers, which tend to be otherwise
1241+
* disadvantaged under our eviction criteria for their higher min ping times
1242+
* relative to IPv4/IPv6 peers, and favorise the diversity of peer connections.
12451243
*/
12461244
void ProtectEvictionCandidatesByRatio(std::vector<NodeEvictionCandidate>& vEvictionCandidates);
12471245

0 commit comments

Comments
 (0)