fn report_state_divergence_if_required(&self, pool: &PoolReader<'_>) {
        let catch_up_package = pool.get_highest_catch_up_package();
        if let Ok(hash) = self
            .state_manager
            .get_state_hash_at(catch_up_package.height())
        {
            // Since the genesis CUP contains a dummy state hash, we only perform this check
            // for heights greater than 0.
            if catch_up_package.height().get() > 0 && hash != catch_up_package.content.state_hash {
                // This will delete the diverged states and panic.
                self.state_manager
                    .report_diverged_state(catch_up_package.height())
            }
        }
    }
/// Checks if the state hash referenced from the latest CUP matches the one
/// returned from our local state manager. Report the divergence if it
/// does not.
Checks if the state hash referenced from the latest CUP matches the one
returned from our local state manager. Report the divergence if it
does not.
Checks if the state hash referenced from the latest CUP matches the one returned from our local state manager . Report the divergence if it does not .
fn report_state_divergence_if_required(&self, pool: &PoolReader<'_>) {
        let catch_up_package = pool.get_highest_catch_up_package();
        if let Ok(hash) = self
            .state_manager
            .get_state_hash_at(catch_up_package.height())
        {
            // Since the genesis CUP contains a dummy state hash, we only perform this check
            // for heights greater than 0.
            if catch_up_package.height().get() > 0 && hash != catch_up_package.content.state_hash {
                // This will delete the diverged states and panic.
                self.state_manager
                    .report_diverged_state(catch_up_package.height())
            }
        }
    }
fn report_state_divergence_if_required ( & self , pool : & PoolReader < ' _ > ) { let catch_up_package = pool . get_highest_catch_up_package ( ) ; if let Ok ( hash ) = self . state_manager . get_state_hash_at ( catch_up_package . height ( ) ) { // Since the genesis CUP contains a dummy state hash, we only perform this check // for heights greater than 0. if catch_up_package . height ( ) . get ( ) > 0 && hash != catch_up_package . content . state_hash { // This will delete the diverged states and panic. self . state_manager . report_diverged_state ( catch_up_package . height ( ) ) } } }
Checks if the state hash referenced from the latest CUP matches the one
returned from our local state manager.
Checks if the state hash referenced from the latest CUP matches the one returned from our local state manager .
&self
pool
&PoolReader<'_>
&self
pool
&PoolReader<'_>