Skip to main content

prune_goal

Function prune_goal 

Source
pub(crate) fn prune_goal(
    len: usize,
    max: usize,
    emergency: usize,
    batch: usize,
) -> usize
Expand description

Calculates the drop goal for one paced receive-path pruning round.

The result is the greater of the uncapped cut to the emergency bound and a batch-limited cut toward the ordinary cap. All arithmetic saturates, and the emergency bound is clamped to the cap.