/// Aborts the in-progress block
///
/// # Errors
///
/// * Returns a `BlockNotInitialized` error if there is no in-progress block
Aborts the in-progress block
Aborts the in - progress block
pub fn cancel_block(&self) -> Result<(), BlockPublisherError> {
        let mut candidate_block = self
            .candidate_block
            .lock()
            .map_err(|_| BlockPublisherError::Internal("Candidate block lock poisoned".into()))?;
        if let Some(mut candidate_block) = candidate_block.take() {
            candidate_block.scheduler.finalize()?;
            candidate_block.scheduler.cancel()?;
            Ok(())
        } else {
            Err(BlockCancellationError::BlockNotInitialized.into())
        }
    }
pub fn cancel_block ( & self ) -> Result < ( ) , BlockPublisherError > { let mut candidate_block = self . candidate_block . lock ( ) . map_err ( | _ | BlockPublisherError :: Internal ( " " . into ( ) ) ) ? ; if let Some ( mut candidate_block ) = candidate_block . take ( ) { candidate_block . scheduler . finalize ( ) ? ; candidate_block . scheduler . cancel ( ) ? ; Ok ( ( ) ) } else { Err ( BlockCancellationError :: BlockNotInitialized . into ( ) ) } }
Aborts the in-progress block
Aborts the in - progress block
&self
errors
Returns a `BlockNotInitialized` error if there is no in-progress block
Returns a ` BlockNotInitialized ` error if there is no in - progress block