pub fn generate_repairs_for_fork<'a>(
        blockstore: &Blockstore,
        repairs: &mut Vec<ShredRepairType>,
        max_repairs: usize,
        slot: Slot,
        duplicate_slot_repair_statuses: &impl Contains<'a, Slot>,
    ) {
        let mut pending_slots = vec![slot];
        while repairs.len() < max_repairs && !pending_slots.is_empty() {
            let slot = pending_slots.pop().unwrap();
            if duplicate_slot_repair_statuses.contains(&slot) {
                // These are repaired through a different path
                continue;
            }
            if let Some(slot_meta) = blockstore.meta(slot).unwrap() {
                let new_repairs = Self::generate_repairs_for_slot(
                    blockstore,
                    slot,
                    &slot_meta,
                    max_repairs - repairs.len(),
                );
                repairs.extend(new_repairs);
                let next_slots = slot_meta.next_slots;
                pending_slots.extend(next_slots);
            } else {
                break;
            }
        }
    }
/// Repairs any fork starting at the input slot
Repairs any fork starting at the input slot
Repairs any fork starting at the input slot
pub fn generate_repairs_for_fork<'a>(
        blockstore: &Blockstore,
        repairs: &mut Vec<ShredRepairType>,
        max_repairs: usize,
        slot: Slot,
        duplicate_slot_repair_statuses: &impl Contains<'a, Slot>,
    ) {
        let mut pending_slots = vec![slot];
        while repairs.len() < max_repairs && !pending_slots.is_empty() {
            let slot = pending_slots.pop().unwrap();
            if duplicate_slot_repair_statuses.contains(&slot) {
                // These are repaired through a different path
                continue;
            }
            if let Some(slot_meta) = blockstore.meta(slot).unwrap() {
                let new_repairs = Self::generate_repairs_for_slot(
                    blockstore,
                    slot,
                    &slot_meta,
                    max_repairs - repairs.len(),
                );
                repairs.extend(new_repairs);
                let next_slots = slot_meta.next_slots;
                pending_slots.extend(next_slots);
            } else {
                break;
            }
        }
    }
pub fn generate_repairs_for_fork < ' a > ( blockstore : & Blockstore , repairs : & mut Vec < ShredRepairType > , max_repairs : usize , slot : Slot , duplicate_slot_repair_statuses : & impl Contains < ' a , Slot > , ) { let mut pending_slots = vec ! [ slot ] ; while repairs . len ( ) < max_repairs && ! pending_slots . is_empty ( ) { let slot = pending_slots . pop ( ) . unwrap ( ) ; if duplicate_slot_repair_statuses . contains ( & slot ) { // These are repaired through a different path continue ; } if let Some ( slot_meta ) = blockstore . meta ( slot ) . unwrap ( ) { let new_repairs = Self :: generate_repairs_for_slot ( blockstore , slot , & slot_meta , max_repairs - repairs . len ( ) , ) ; repairs . extend ( new_repairs ) ; let next_slots = slot_meta . next_slots ; pending_slots . extend ( next_slots ) ; } else { break ; } } }
Repairs any fork starting at the input slot
Repairs any fork starting at the input slot
blockstore
&Blockstore
repairs
&mut Vec<ShredRepairType>
max_repairs
usize
slot
Slot
duplicate_slot_repair_statuses
&impl Contains<'a, Slot>