fix buildExtendedCommitInfo logic to allow default

This commit is contained in:
William Banfield
2022-05-13 13:49:00 -04:00
parent 8935da8872
commit ec46cc4006

View File

@@ -469,7 +469,8 @@ func buildExtendedCommitInfo(ec *types.ExtendedCommit, store Store, initialHeigh
if ecs.BlockIDFlag == types.BlockIDFlagCommit {
// We only care about vote extensions if a validator has voted to
// commit.
if ecs.Extension == nil && ecs.ExtensionSignature == nil && ec.Height > extensionRequireHeight {
if ecs.Extension == nil && ecs.ExtensionSignature == nil &&
extensionRequireHeight != 0 && ec.Height >= extensionRequireHeight {
// TODO: this error is akward, make it better
panic(fmt.Errorf("commit received with missing vote extension data"))
}