pub fn insert_timeout_certificate(&self, tc: Arc<TimeoutCertificate>) -> anyhow::Result<()> {
        let cur_tc_round = self.highest_timeout_cert().map_or(0, |tc| tc.round());
        if tc.round() <= cur_tc_round {
            return Ok(());
        }
        self.storage
            .save_highest_timeout_cert(tc.as_ref().clone())
            .context("Timeout certificate insert failed when persisting to DB")?;
        self.inner.write().unwrap().replace_timeout_cert(tc);
        Ok(())
    }
/// Replace the highest timeout certificate in case the given one has a higher round.
/// In case a timeout certificate is updated, persist it to storage.
Replace the highest timeout certificate in case the given one has a higher round.
In case a timeout certificate is updated, persist it to storage.
Replace the highest timeout certificate in case the given one has a higher round . In case a timeout certificate is updated persist it to storage .
pub fn insert_timeout_certificate(&self, tc: Arc<TimeoutCertificate>) -> anyhow::Result<()> {
        let cur_tc_round = self.highest_timeout_cert().map_or(0, |tc| tc.round());
        if tc.round() <= cur_tc_round {
            return Ok(());
        }
        self.storage
            .save_highest_timeout_cert(tc.as_ref().clone())
            .context("Timeout certificate insert failed when persisting to DB")?;
        self.inner.write().unwrap().replace_timeout_cert(tc);
        Ok(())
    }
pub fn insert_timeout_certificate ( & self , tc : Arc < TimeoutCertificate > ) -> anyhow :: Result < ( ) > { let cur_tc_round = self . highest_timeout_cert ( ) . map_or ( 0 , | tc | tc . round ( ) ) ; if tc . round ( ) <= cur_tc_round { return Ok ( ( ) ) ; } self . storage . save_highest_timeout_cert ( tc . as_ref ( ) . clone ( ) ) . context ( " " ) ? ; self . inner . write ( ) . unwrap ( ) . replace_timeout_cert ( tc ) ; Ok ( ( ) ) }
Replace the highest timeout certificate in case the given one has a higher round.
Replace the highest timeout certificate in case the given one has a higher round .
&self
tc
Arc<TimeoutCertificate>
&self
tc
Arc<TimeoutCertificate>