fn generate_repairs_for_fork(
        blocktree: &Blocktree,
        repairs: &mut Vec<RepairType>,
        max_repairs: usize,
        slot: u64,
    ) {
        let mut pending_slots = vec![slot];
        while repairs.len() < max_repairs && !pending_slots.is_empty() {
            let slot = pending_slots.pop().unwrap();
            if let Some(slot_meta) = blocktree.meta(slot).unwrap() {
                let new_repairs = Self::generate_repairs_for_slot(
                    blocktree,
                    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
fn generate_repairs_for_fork(
        blocktree: &Blocktree,
        repairs: &mut Vec<RepairType>,
        max_repairs: usize,
        slot: u64,
    ) {
        let mut pending_slots = vec![slot];
        while repairs.len() < max_repairs && !pending_slots.is_empty() {
            let slot = pending_slots.pop().unwrap();
            if let Some(slot_meta) = blocktree.meta(slot).unwrap() {
                let new_repairs = Self::generate_repairs_for_slot(
                    blocktree,
                    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;
            }
        }
    }
fn generate_repairs_for_fork ( blocktree : & Blocktree , repairs : & mut Vec < RepairType > , max_repairs : usize , slot : u64 , ) { let mut pending_slots = vec ! [ slot ] ; while repairs . len ( ) < max_repairs && ! pending_slots . is_empty ( ) { let slot = pending_slots . pop ( ) . unwrap ( ) ; if let Some ( slot_meta ) = blocktree . meta ( slot ) . unwrap ( ) { let new_repairs = Self :: generate_repairs_for_slot ( blocktree , 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
blocktree
&Blocktree
repairs
&mut Vec<RepairType>
max_repairs
usize
slot
u64
blocktree
&Blocktree
repairs
&mut Vec<RepairType>
max_repairs
usize
slot
u64