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.

Synopsis

Declared in <node/eviction.h>

[[nodiscard]]
std::optional<NodeId>
SelectNodeToEvict(std::vector<NodeEvictionCandidate>&& vEvictionCandidates);

Return Value

The peer selected for eviction, or std::nullopt if none should be evicted.

Note

The return value should not be discarded.

Parameters

Name

Description

vEvictionCandidates

The inbound peers considered for eviction.

Created with MrDocs