// Calculate the base checkpoint index based on the rewind history length and the number of checkpoints.
Calculate the base checkpoint index based on the rewind history length and the number of checkpoints.
Calculate the base checkpoint index based on the rewind history length and the number of checkpoints .
fn calculate_base_cp_index(&mut self) -> Result<usize, MerkleMountainRangeError> {
        let cp_count = self
            .checkpoints
            .len()
            .map_err(|e| MerkleMountainRangeError::BackendError(e.to_string()))?;
        if cp_count > self.config.rewind_hist_len {
            return Ok(cp_count - self.config.rewind_hist_len);
        }
        Ok(0)
    }
fn calculate_base_cp_index ( & mut self ) -> Result < usize , MerkleMountainRangeError > { let cp_count = self . checkpoints . len ( ) . map_err ( | e | MerkleMountainRangeError :: BackendError ( e . to_string ( ) ) ) ? ; if cp_count > self . config . rewind_hist_len { return Ok ( cp_count - self . config . rewind_hist_len ) ; } Ok ( 0 ) }
Calculate the base checkpoint index based on the rewind history length and the number of checkpoints.
Calculate the base checkpoint index based on the rewind history length and the number of checkpoints .
&mut self