Select an inbound peer to evict after filtering out (protecting) peers having distinct, difficult-to-forge characteristics. The protection logic picks out fixed numbers of desirable peers per various criteria, followed by (mostly) ratios of desirable or disadvantaged peers. If any eviction candidates remain, the selection logic chooses a peer to evict.
Declared in <node/eviction.h>
[[nodiscard]]
std::optional<NodeId>
SelectNodeToEvict(std::vector<NodeEvictionCandidate>&& vEvictionCandidates);
The peer selected for eviction, or std::nullopt if none should be evicted.
The return value should not be discarded.
| Name | Description |
|---|---|
| vEvictionCandidates | The inbound peers considered for eviction. |