[#SelectNodeToEvict]
= SelectNodeToEvict
:mrdocs:

Select an inbound peer to evict after filtering out (protecting) peers having distinct, difficult&hyphen;to&hyphen;forge characteristics&period; The protection logic picks out fixed numbers of desirable peers per various criteria, followed by (mostly) ratios of desirable or disadvantaged peers&period; If any eviction candidates remain, the selection logic chooses a peer to evict&period;

== Synopsis

Declared in `&lt;node&sol;eviction&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
&lsqb;&lsqb;nodiscard&rsqb;&rsqb;
std::optional&lt;NodeId&gt;
SelectNodeToEvict(std::vector&lt;NodeEvictionCandidate&gt;&& vEvictionCandidates);
----

== Return Value

The peer selected for eviction, or std&colon;&colon;nullopt if none should be evicted&period;

[NOTE]
====
The return value https://en.cppreference.com/cpp/language/attributes/nodiscard[should not be discarded^].
====
== Parameters

[cols="1,4"]
|===
| Name| Description
| *vEvictionCandidates*
| The inbound peers considered for eviction&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
