File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -903,7 +903,7 @@ void ProtectEvictionCandidatesByRatio(std::vector<NodeEvictionCandidate>& vEvict
903
903
// longest uptime overall. This helps protect tor peers, which tend to be otherwise
904
904
// disadvantaged under our eviction criteria.
905
905
const size_t initial_size = vEvictionCandidates.size ();
906
- size_t total_protect_size = initial_size / 2 ;
906
+ const size_t total_protect_size{ initial_size / 2 } ;
907
907
const size_t onion_protect_size = total_protect_size / 2 ;
908
908
909
909
if (onion_protect_size) {
@@ -926,8 +926,8 @@ void ProtectEvictionCandidatesByRatio(std::vector<NodeEvictionCandidate>& vEvict
926
926
927
927
// Calculate how many we removed, and update our total number of peers that
928
928
// we want to protect based on uptime accordingly.
929
- total_protect_size -= initial_size - vEvictionCandidates.size ();
930
- EraseLastKElements (vEvictionCandidates, ReverseCompareNodeTimeConnected, total_protect_size );
929
+ const size_t remaining_to_protect{ total_protect_size - ( initial_size - vEvictionCandidates.size ())} ;
930
+ EraseLastKElements (vEvictionCandidates, ReverseCompareNodeTimeConnected, remaining_to_protect );
931
931
}
932
932
933
933
[[nodiscard]] std::optional<NodeId> SelectNodeToEvict (std::vector<NodeEvictionCandidate>&& vEvictionCandidates)
You can’t perform that action at this time.
0 commit comments