pub fn verify_for_unrooted_optimistic_slots(
        &mut self,
        root_bank: &Bank,
        blockstore: &Blockstore,
    ) -> Vec<(Slot, Hash)> {
        let root = root_bank.slot();
        let root_ancestors = &root_bank.ancestors;
        let mut slots_before_root = self
            .unchecked_slots
            .split_off(&((root + 1), Hash::default()));
        // `slots_before_root` now contains all slots <= root
        std::mem::swap(&mut slots_before_root, &mut self.unchecked_slots);
        slots_before_root
            .into_iter()
            .filter(|(optimistic_slot, optimistic_hash)| {
                (*optimistic_slot == root && *optimistic_hash != root_bank.hash())
                    || (!root_ancestors.contains_key(optimistic_slot) &&
                    // In this second part of the `and`, we account for the possibility that
                    // there was some other root `rootX` set in BankForks where:
                    //
                    // `root` > `rootX` > `optimistic_slot`
                    //
                    // in which case `root` may  not contain the ancestor information for
                    // slots < `rootX`, so we also have to check if `optimistic_slot` was rooted
                    // through blockstore.
                    !blockstore.is_root(*optimistic_slot))
            })
            .collect()
    }
// Returns any optimistic slots that were not rooted
Returns any optimistic slots that were not rooted
Returns any optimistic slots that were not rooted
pub fn verify_for_unrooted_optimistic_slots(
        &mut self,
        root_bank: &Bank,
        blockstore: &Blockstore,
    ) -> Vec<(Slot, Hash)> {
        let root = root_bank.slot();
        let root_ancestors = &root_bank.ancestors;
        let mut slots_before_root = self
            .unchecked_slots
            .split_off(&((root + 1), Hash::default()));
        // `slots_before_root` now contains all slots <= root
        std::mem::swap(&mut slots_before_root, &mut self.unchecked_slots);
        slots_before_root
            .into_iter()
            .filter(|(optimistic_slot, optimistic_hash)| {
                (*optimistic_slot == root && *optimistic_hash != root_bank.hash())
                    || (!root_ancestors.contains_key(optimistic_slot) &&
                    // In this second part of the `and`, we account for the possibility that
                    // there was some other root `rootX` set in BankForks where:
                    //
                    // `root` > `rootX` > `optimistic_slot`
                    //
                    // in which case `root` may  not contain the ancestor information for
                    // slots < `rootX`, so we also have to check if `optimistic_slot` was rooted
                    // through blockstore.
                    !blockstore.is_root(*optimistic_slot))
            })
            .collect()
    }
pub fn verify_for_unrooted_optimistic_slots ( & mut self , root_bank : & Bank , blockstore : & Blockstore , ) -> Vec < ( Slot , Hash ) > { let root = root_bank . slot ( ) ; let root_ancestors = & root_bank . ancestors ; let mut slots_before_root = self . unchecked_slots . split_off ( & ( ( root + 1 ) , Hash :: default ( ) ) ) ; // `slots_before_root` now contains all slots <= root std :: mem :: swap ( & mut slots_before_root , & mut self . unchecked_slots ) ; slots_before_root . into_iter ( ) . filter ( | ( optimistic_slot , optimistic_hash ) | { ( * optimistic_slot == root && * optimistic_hash != root_bank . hash ( ) ) || ( ! root_ancestors . contains_key ( optimistic_slot ) && // In this second part of the `and`, we account for the possibility that // there was some other root `rootX` set in BankForks where: // // `root` > `rootX` > `optimistic_slot` // // in which case `root` may  not contain the ancestor information for // slots < `rootX`, so we also have to check if `optimistic_slot` was rooted // through blockstore. ! blockstore . is_root ( * optimistic_slot ) ) } ) . collect ( ) }
Returns any optimistic slots that were not rooted
Returns any optimistic slots that were not rooted
&mut self
root_bank
&Bank
blockstore
&Blockstore