Skip to main content

select_sync_batch

Function select_sync_batch 

Source
pub fn select_sync_batch(
    state: &mut NeighborSyncState,
    peer_count: usize,
    cooldown: Duration,
) -> Vec<PeerId>
Expand description

Select the next batch of peers for sync from the current cycle.

Priority peers from routing-table churn are drained before the round-robin cursor. Rules 2-3 then scan forward from cursor, skip peers still under cooldown, and fill up to peer_count slots.