pub fn add_votes<'a, 'b>(
        &'a mut self,
        // newly updated votes on a fork
        pubkey_votes: impl Iterator<Item = impl Borrow<(Pubkey, SlotHashKey)> + 'b>,
        epoch_stakes: &HashMap<Epoch, EpochStakes>,
        epoch_schedule: &EpochSchedule,
    ) -> SlotHashKey {
        // Generate the set of updates
        let update_operations_batch =
            self.generate_update_operations(pubkey_votes, epoch_stakes, epoch_schedule);

        // Finalize all updates
        self.process_update_operations(update_operations_batch);
        self.best_overall_slot()
    }
// Add new votes, returns the best slot
Add new votes, returns the best slot
Add new votes returns the best slot
pub fn add_votes<'a, 'b>(
        &'a mut self,
        // newly updated votes on a fork
        pubkey_votes: impl Iterator<Item = impl Borrow<(Pubkey, SlotHashKey)> + 'b>,
        epoch_stakes: &HashMap<Epoch, EpochStakes>,
        epoch_schedule: &EpochSchedule,
    ) -> SlotHashKey {
        // Generate the set of updates
        let update_operations_batch =
            self.generate_update_operations(pubkey_votes, epoch_stakes, epoch_schedule);
        // Finalize all updates
        self.process_update_operations(update_operations_batch);
        self.best_overall_slot()
    }
pub fn add_votes < ' a , ' b > ( & ' a mut self , // newly updated votes on a fork pubkey_votes : impl Iterator < Item = impl Borrow < ( Pubkey , SlotHashKey ) > + ' b > , epoch_stakes : & HashMap < Epoch , EpochStakes > , epoch_schedule : & EpochSchedule , ) -> SlotHashKey { // Generate the set of updates let update_operations_batch = self . generate_update_operations ( pubkey_votes , epoch_stakes , epoch_schedule ) ; // Finalize all updates self . process_update_operations ( update_operations_batch ) ; self . best_overall_slot ( ) }
Add new votes, returns the best slot
Add new votes returns the best slot
&'a mut self
pubkey_votes
impl Iterator<Item = impl Borrow<(Pubkey, SlotHashKey)> + 'b>
epoch_stakes
&HashMap<Epoch, EpochStakes>
epoch_schedule
&EpochSchedule