diff --git a/app/app.go b/app/app.go index d79df9e98f..ba302bcf69 100644 --- a/app/app.go +++ b/app/app.go @@ -982,16 +982,13 @@ func (app *App) FinalizeBlocker(ctx sdk.Context, req *abci.RequestFinalizeBlock) ctx.Logger().Info(fmt.Sprintf("FinalizeBlock took %dms", duration/time.Millisecond)) }() - if app.optimisticProcessingInfo != nil && !app.optimisticProcessingInfo.Aborted && bytes.Equal(app.optimisticProcessingInfo.Hash, req.Hash) { - select { - case <-app.optimisticProcessingInfo.Completion: + if app.optimisticProcessingInfo != nil { + <-app.optimisticProcessingInfo.Completion + if !app.optimisticProcessingInfo.Aborted && bytes.Equal(app.optimisticProcessingInfo.Hash, req.Hash) { app.SetProcessProposalStateToCommit() appHash := app.WriteStateToCommitAndGetWorkingHash() resp := app.getFinalizeBlockResponse(appHash, app.optimisticProcessingInfo.Events, app.optimisticProcessingInfo.TxRes, app.optimisticProcessingInfo.EndBlockResp) return &resp, nil - case <-time.After(OptimisticProcessingTimeoutInSeconds * time.Second): - ctx.Logger().Info("optimistic processing timed out") - break } } ctx.Logger().Info("optimistic processing ineligible")