fn vote_committed_state()

in librabft-v2/src/record_store.rs [237:255]


    fn vote_committed_state(
        &self,
        block_hash: BlockHash<Context::HashValue>,
    ) -> Option<Context::State> {
        let block = self.block(block_hash).unwrap();
        let r3 = block.value.round;
        let qc2_hash = block.value.previous_quorum_certificate_hash;
        let mut iter = BackwardQuorumCertificateIterator::new(&self, qc2_hash);
        let opt_qc2 = iter.next();
        let opt_qc1 = iter.next();
        if let (Some(qc1), Some(qc2)) = (opt_qc1, opt_qc2) {
            let r2 = qc2.value.round;
            let r1 = qc1.value.round;
            if r3 == r2 + 1 && r2 == r1 + 1 {
                return Some(qc1.value.state.clone());
            }
        }
        None
    }