Remove ExtendedCommitSig.ForBlock helper

Signed-off-by: Thane Thomson <connect@thanethomson.com>
This commit is contained in:
Thane Thomson
2022-05-07 10:15:59 -04:00
parent 08bf156462
commit a27365b09a
2 changed files with 1 additions and 6 deletions
-5
View File
@@ -737,11 +737,6 @@ func NewExtendedCommitSigAbsent() ExtendedCommitSig {
return ExtendedCommitSig{BlockIDFlag: BlockIDFlagAbsent}
}
// ForBlock returns true if ExtendedCommitSig is for the block.
func (ecs ExtendedCommitSig) ForBlock() bool {
return ecs.BlockIDFlag == BlockIDFlagCommit
}
// Absent returns true if ExtendedCommitSig is absent.
func (ecs ExtendedCommitSig) Absent() bool {
// TODO(sergio): What about BlockIDFlagNil?
+1 -1
View File
@@ -628,7 +628,7 @@ func (voteSet *VoteSet) MakeExtendedCommit() *ExtendedCommit {
for i, v := range voteSet.votes {
sig := v.ExtendedCommitSig()
// if block ID exists but doesn't match, exclude sig
if sig.ForBlock() && !v.BlockID.Equals(*voteSet.maj23) {
if sig.BlockIDFlag == BlockIDFlagCommit && !v.BlockID.Equals(*voteSet.maj23) {
sig = NewExtendedCommitSigAbsent()
}