async fn finalize_horizon_sync(&self) -> Result<(), HorizonSyncError> {
        debug!(target: LOG_TARGET, "Validating horizon state");
        let validator = self.shared.sync_validators.final_state.clone();
        let horizon_sync_height = self.horizon_sync_height;
        let validation_result = spawn_blocking(move || {
            validator
                .validate(&horizon_sync_height)
                .map_err(HorizonSyncError::FinalStateValidationFailed)
        })
        .await?;

        match validation_result {
            Ok(_) => {
                debug!(
                    target: LOG_TARGET,
                    "Horizon state validation succeeded! Committing horizon state."
                );
                async_db::horizon_sync_commit(self.db()).await?;
                Ok(())
            },
            Err(err) => {
                debug!(target: LOG_TARGET, "Horizon state validation failed!");
                Err(err)
            },
        }
    }
// Finalize the horizon state synchronization by setting the chain metadata to the local tip and committing
// the horizon state to the blockchain backend.
Finalize the horizon state synchronization by setting the chain metadata to the local tip and committing
the horizon state to the blockchain backend.
Finalize the horizon state synchronization by setting the chain metadata to the local tip and committing the horizon state to the blockchain backend .
async fn finalize_horizon_sync(&self) -> Result<(), HorizonSyncError> {
        debug!(target: LOG_TARGET, "Validating horizon state");
        let validator = self.shared.sync_validators.final_state.clone();
        let horizon_sync_height = self.horizon_sync_height;
        let validation_result = spawn_blocking(move || {
            validator
                .validate(&horizon_sync_height)
                .map_err(HorizonSyncError::FinalStateValidationFailed)
        })
        .await?;
        match validation_result {
            Ok(_) => {
                debug!(
                    target: LOG_TARGET,
                    "Horizon state validation succeeded! Committing horizon state."
                );
                async_db::horizon_sync_commit(self.db()).await?;
                Ok(())
            },
            Err(err) => {
                debug!(target: LOG_TARGET, "Horizon state validation failed!");
                Err(err)
            },
        }
    }
async fn finalize_horizon_sync ( & self ) -> Result < ( ) , HorizonSyncError > { debug ! ( target LOG_TARGET " " ) ; let validator = self . shared . sync_validators . final_state . clone ( ) ; let horizon_sync_height = self . horizon_sync_height ; let validation_result = spawn_blocking ( move | | { validator . validate ( & horizon_sync_height ) . map_err ( HorizonSyncError :: FinalStateValidationFailed ) } ) . await ? ; match validation_result { Ok ( _ ) => { debug ! ( target LOG_TARGET " " ) ; async_db :: horizon_sync_commit ( self . db ( ) ) . await ? ; Ok ( ( ) ) } , Err ( err ) => { debug ! ( target LOG_TARGET " " ) ; Err ( err ) } , } }
Finalize the horizon state synchronization by setting the chain metadata to the local tip and committing
the horizon state to the blockchain backend.
Finalize the horizon state synchronization by setting the chain metadata to the local tip and committing the horizon state to the blockchain backend .
&self
&self