pub(crate) fn populate_ancestor_voted_stakes(
        voted_stakes: &mut VotedStakes,
        vote: &Lockout,
        ancestors: &HashMap<Slot, HashSet<Slot>>,
    ) {
        // If there's no ancestors, that means this slot must be from before the current root,
        // in which case the lockouts won't be calculated in bank_weight anyways, so ignore
        // this slot
        let vote_slot_ancestors = ancestors.get(&vote.slot);
        if vote_slot_ancestors.is_none() {
            return;
        }
        let mut slot_with_ancestors = vec![vote.slot];
        slot_with_ancestors.extend(vote_slot_ancestors.unwrap());
        for slot in slot_with_ancestors {
            voted_stakes.entry(slot).or_default();
        }
    }
/// Update lockouts for all the ancestors
Update lockouts for all the ancestors
Update lockouts for all the ancestors
pub(crate) fn populate_ancestor_voted_stakes(
        voted_stakes: &mut VotedStakes,
        vote: &Lockout,
        ancestors: &HashMap<Slot, HashSet<Slot>>,
    ) {
        // If there's no ancestors, that means this slot must be from before the current root,
        // in which case the lockouts won't be calculated in bank_weight anyways, so ignore
        // this slot
        let vote_slot_ancestors = ancestors.get(&vote.slot);
        if vote_slot_ancestors.is_none() {
            return;
        }
        let mut slot_with_ancestors = vec![vote.slot];
        slot_with_ancestors.extend(vote_slot_ancestors.unwrap());
        for slot in slot_with_ancestors {
            voted_stakes.entry(slot).or_default();
        }
    }
pub ( crate ) fn populate_ancestor_voted_stakes ( voted_stakes : & mut VotedStakes , vote : & Lockout , ancestors : & HashMap < Slot , HashSet < Slot > > , ) { // If there's no ancestors, that means this slot must be from before the current root, // in which case the lockouts won't be calculated in bank_weight anyways, so ignore // this slot let vote_slot_ancestors = ancestors . get ( & vote . slot ) ; if vote_slot_ancestors . is_none ( ) { return ; } let mut slot_with_ancestors = vec ! [ vote slot ] ; slot_with_ancestors . extend ( vote_slot_ancestors . unwrap ( ) ) ; for slot in slot_with_ancestors { voted_stakes . entry ( slot ) . or_default ( ) ; } }
Update lockouts for all the ancestors
Update lockouts for all the ancestors
voted_stakes
&mut VotedStakes
vote
&Lockout
ancestors
&HashMap<Slot, HashSet<Slot>>
voted_stakes
&mut VotedStakes
vote
&Lockout
ancestors
&HashMap<Slot, HashSet<Slot>>