use helper methods in prepareproposal

This commit is contained in:
William Banfield
2022-05-13 17:30:45 -04:00
parent bc00c60b28
commit ecaf84368b
2 changed files with 10 additions and 13 deletions
+4 -2
View File
@@ -772,8 +772,10 @@ func (ecs ExtendedCommitSig) ValidateBasic() error {
// EnsureExtensions validates that a vote extensions signature is present for
// this ExtendedCommitSig.
func (ecs ExtendedCommitSig) EnsureExtension() error {
if len(ecs.ExtensionSignature) == 0 {
return errors.New("vote extension signature is missing")
if ecs.BlockIDFlag == BlockIDFlagCommit {
if len(ecs.ExtensionSignature) == 0 {
return errors.New("vote extension signature is missing")
}
}
return nil
}