// check if there are enough prevotes to justify a precommit given a quorum
check if there are enough prevotes to justify a precommit given a quorum
// check if there are enough prevotes to justify a precommit given a quorum
func (acc *Accountability) checkQuorumPrevotesForPrecommit(vs *common.VoteSet, precommit *common.Message) bool {
	numberOfAppropriateMessages := uint64(0)
	for _, receivedPrevoteMessage := range vs.ReceivedPrevoteMessages {
		if receivedPrevoteMessage.Value != nil && receivedPrevoteMessage.Value.Equal(precommit.Value) && receivedPrevoteMessage.Round == precommit.Round {
			numberOfAppropriateMessages++
		}
	}
	return numberOfAppropriateMessages >= acc.getQuorumThreshold()
}
func ( acc * Accountability ) checkQuorumPrevotesForPrecommit ( vs * common . VoteSet , precommit * common . Message ) bool { numberOfAppropriateMessages := uint64 ( 0 ) for _ , receivedPrevoteMessage := range vs . ReceivedPrevoteMessages { if receivedPrevoteMessage . Value != nil && receivedPrevoteMessage . Value . Equal ( precommit . Value ) && receivedPrevoteMessage . Round == precommit . Round { numberOfAppropriateMessages ++ } } return numberOfAppropriateMessages >= acc . getQuorumThreshold ( ) }
check if there are enough prevotes to justify a precommit given a quorum
check if there are enough prevotes to justify a precommit given a quorum