fn aggregate_tc(
        &mut self,
        vote: &Vote,
        validator_verifier: &ValidatorVerifier,
    ) -> Option<VoteReceptionResult> {
        let timeout_signature = vote.timeout_signature().cloned()?;
        let timeout = vote.timeout();
        let tc = self
            .round_to_tc
            .entry(timeout.round())
            .or_insert_with(|| TimeoutCertificate::new(timeout));
        tc.add_signature(vote.author(), timeout_signature);
        match validator_verifier.check_voting_power(tc.signatures().keys()) {
            Ok(_) => Some(VoteReceptionResult::NewTimeoutCertificate(Arc::new(
                tc.clone(),
            ))),
            Err(VerifyError::TooLittleVotingPower { .. }) => None,
            _ => panic!("Unexpected verification error, vote = {}", vote),
        }
    }
/// In case a timeout certificate is formed (there are 2f+1 votes in the same round) return the
/// new TimeoutCertificate, otherwise, return None.
In case a timeout certificate is formed (there are 2f+1 votes in the same round) return the
new TimeoutCertificate, otherwise, return None.
In case a timeout certificate is formed ( there are 2f + 1 votes in the same round ) return the new TimeoutCertificate otherwise return None .
fn aggregate_tc(
        &mut self,
        vote: &Vote,
        validator_verifier: &ValidatorVerifier,
    ) -> Option<VoteReceptionResult> {
        let timeout_signature = vote.timeout_signature().cloned()?;
        let timeout = vote.timeout();
        let tc = self
            .round_to_tc
            .entry(timeout.round())
            .or_insert_with(|| TimeoutCertificate::new(timeout));
        tc.add_signature(vote.author(), timeout_signature);
        match validator_verifier.check_voting_power(tc.signatures().keys()) {
            Ok(_) => Some(VoteReceptionResult::NewTimeoutCertificate(Arc::new(
                tc.clone(),
            ))),
            Err(VerifyError::TooLittleVotingPower { .. }) => None,
            _ => panic!("Unexpected verification error, vote = {}", vote),
        }
    }
fn aggregate_tc ( & mut self , vote : & Vote , validator_verifier : & ValidatorVerifier , ) -> Option < VoteReceptionResult > { let timeout_signature = vote . timeout_signature ( ) . cloned ( ) ? ; let timeout = vote . timeout ( ) ; let tc = self . round_to_tc . entry ( timeout . round ( ) ) . or_insert_with ( | | TimeoutCertificate :: new ( timeout ) ) ; tc . add_signature ( vote . author ( ) , timeout_signature ) ; match validator_verifier . check_voting_power ( tc . signatures ( ) . keys ( ) ) { Ok ( _ ) => Some ( VoteReceptionResult :: NewTimeoutCertificate ( Arc :: new ( tc . clone ( ) , ) ) ) , Err ( VerifyError :: TooLittleVotingPower { .. } ) => None , _ => panic ! ( " " vote ) , } }
In case a timeout certificate is formed (there are 2f+1 votes in the same round) return the
new TimeoutCertificate, otherwise, return None.
In case a timeout certificate is formed ( there are 2f + 1 votes in the same round ) return the new TimeoutCertificate otherwise return None .
&mut self
vote
&Vote
validator_verifier
&ValidatorVerifier
&mut self
vote
&Vote
validator_verifier
&ValidatorVerifier