// Returns:
// 1) The heaviest overall bank
// 2) The heaviest bank on the same fork as the last vote (doesn't require a
// switching proof to vote for)
1) The heaviest overall bank
2) The heaviest bank on the same fork as the last vote (doesn't require a
switching proof to vote for)
1 ) The heaviest overall bank 2 ) The heaviest bank on the same fork as the last vote ( doesn ' t require a switching proof to vote for )
fn select_forks(
        &self,
        _frozen_banks: &[Arc<Bank>],
        tower: &Tower,
        _progress: &ProgressMap,
        _ancestors: &HashMap<u64, HashSet<u64>>,
        bank_forks: &RwLock<BankForks>,
    ) -> (Arc<Bank>, Option<Arc<Bank>>) {
        let r_bank_forks = bank_forks.read().unwrap();
        // BankForks should only contain one valid version of this slot
        (
            r_bank_forks
                .get_with_checked_hash(self.best_overall_slot())
                .unwrap()
                .clone(),
            self.heaviest_slot_on_same_voted_fork(tower)
                .map(|slot_hash| {
                    // BankForks should only contain one valid version of this slot
                    r_bank_forks
                        .get_with_checked_hash(slot_hash)
                        .unwrap()
                        .clone()
                }),
        )
    }
fn select_forks ( & self , _frozen_banks : & [ Arc < Bank > ] , tower : & Tower , _progress : & ProgressMap , _ancestors : & HashMap < u64 , HashSet < u64 > > , bank_forks : & RwLock < BankForks > , ) -> ( Arc < Bank > , Option < Arc < Bank > > ) { let r_bank_forks = bank_forks . read ( ) . unwrap ( ) ; // BankForks should only contain one valid version of this slot ( r_bank_forks . get_with_checked_hash ( self . best_overall_slot ( ) ) . unwrap ( ) . clone ( ) , self . heaviest_slot_on_same_voted_fork ( tower ) . map ( | slot_hash | { // BankForks should only contain one valid version of this slot r_bank_forks . get_with_checked_hash ( slot_hash ) . unwrap ( ) . clone ( ) } ) , ) }
Returns:
1) The heaviest overall bank
2) The heaviest bank on the same fork as the last vote (doesn't require a
switching proof to vote for)
Returns : 1 ) The heaviest overall bank 2 ) The heaviest bank on the same fork as the last vote ( doesn ' t require a switching proof to vote for )
&self
<not_specific>
_frozen_banks
&[Arc<Bank>]
<not_specific>
tower
&Tower
<not_specific>
_progress
&ProgressMap
<not_specific>
_ancestors
&HashMap<u64, HashSet<u64>>
<not_specific>
bank_forks
&RwLock<BankForks>
<not_specific>