pub(crate) fn add(&mut self, signed_vote: &SignedVote, vote_weight: u64) -> BftResult<()> {
        let vote = &signed_vote.vote;
        if self.votes_by_sender.contains_key(&vote.voter) {
            return Err(BftError::RecvMsgAgain(format!("{:?}", signed_vote)));
        }
        self.votes_by_sender
            .insert(vote.voter.clone(), signed_vote.to_owned());
        self.count += vote_weight;
        *self
            .votes_by_proposal
            .entry(vote.block_hash.clone())
            .or_insert(0) += vote_weight;
        Ok(())
    }
/// A function to add a vote to the vote set.
A function to add a vote to the vote set.
A function to add a vote to the vote set .
pub(crate) fn add(&mut self, signed_vote: &SignedVote, vote_weight: u64) -> BftResult<()> {
        let vote = &signed_vote.vote;
        if self.votes_by_sender.contains_key(&vote.voter) {
            return Err(BftError::RecvMsgAgain(format!("{:?}", signed_vote)));
        }
        self.votes_by_sender
            .insert(vote.voter.clone(), signed_vote.to_owned());
        self.count += vote_weight;
        *self
            .votes_by_proposal
            .entry(vote.block_hash.clone())
            .or_insert(0) += vote_weight;
        Ok(())
    }
pub ( crate ) fn add ( & mut self , signed_vote : & SignedVote , vote_weight : u64 ) -> BftResult < ( ) > { let vote = & signed_vote . vote ; if self . votes_by_sender . contains_key ( & vote . voter ) { return Err ( BftError :: RecvMsgAgain ( format ! ( " " signed_vote ) ) ) ; } self . votes_by_sender . insert ( vote . voter . clone ( ) , signed_vote . to_owned ( ) ) ; self . count += vote_weight ; * self . votes_by_proposal . entry ( vote . block_hash . clone ( ) ) . or_insert ( 0 ) += vote_weight ; Ok ( ( ) ) }
A function to add a vote to the vote set.
A function to add a vote to the vote set .
&mut self
signed_vote
&SignedVote
vote_weight
u64
&mut self
signed_vote
&SignedVote
vote_weight
u64