/// This sets the current validator verifier and updates the epoch and round information
/// if this is a new epoch ending ledger info. It also sets the current waypoint to this
/// LedgerInfo.
This sets the current validator verifier and updates the epoch and round information
if this is a new epoch ending ledger info. It also sets the current waypoint to this
LedgerInfo.
This sets the current validator verifier and updates the epoch and round information if this is a new epoch ending ledger info . It also sets the current waypoint to this LedgerInfo .
fn start_new_epoch(&mut self, ledger_info: &LedgerInfo) -> Result<(), Error> {
        debug!("Starting new epoch.");
        let epoch_state = ledger_info
            .next_epoch_state()
            .cloned()
            .ok_or(Error::InvalidLedgerInfo)?;
        self.reconcile_key(&epoch_state)?;
        self.validator_verifier = Some(epoch_state.verifier);
        let current_epoch = self.persistent_storage.epoch()?;
        if current_epoch < epoch_state.epoch {
            // This is ordered specifically to avoid configuration issues:
            // * First set the waypoint to lock in the minimum restarting point,
            // * set the round information,
            // * finally, set the epoch information because once the epoch is set, this `if`
            // statement cannot be re-entered.
            self.persistent_storage
                .set_waypoint(&Waypoint::new_epoch_boundary(ledger_info)?)?;
            self.persistent_storage.set_last_voted_round(0)?;
            self.persistent_storage.set_preferred_round(0)?;
            self.persistent_storage.set_epoch(epoch_state.epoch)?;
        }
        Ok(())
    }
fn start_new_epoch ( & mut self , ledger_info : & LedgerInfo ) -> Result < ( ) , Error > { debug ! ( " " ) ; let epoch_state = ledger_info . next_epoch_state ( ) . cloned ( ) . ok_or ( Error :: InvalidLedgerInfo ) ? ; self . reconcile_key ( & epoch_state ) ? ; self . validator_verifier = Some ( epoch_state . verifier ) ; let current_epoch = self . persistent_storage . epoch ( ) ? ; if current_epoch < epoch_state . epoch { // This is ordered specifically to avoid configuration issues: // * First set the waypoint to lock in the minimum restarting point, // * set the round information, // * finally, set the epoch information because once the epoch is set, this `if` // statement cannot be re-entered. self . persistent_storage . set_waypoint ( & Waypoint :: new_epoch_boundary ( ledger_info ) ? ) ? ; self . persistent_storage . set_last_voted_round ( 0 ) ? ; self . persistent_storage . set_preferred_round ( 0 ) ? ; self . persistent_storage . set_epoch ( epoch_state . epoch ) ? ; } Ok ( ( ) ) }
This sets the current validator verifier and updates the epoch and round information
if this is a new epoch ending ledger info.
This sets the current validator verifier and updates the epoch and round information if this is a new epoch ending ledger info .
&mut self
ledger_info
&LedgerInfo