Skip to content

Commit

Permalink
go/consensus/tendermint/apps/roothash: Clear timeout in emitEmptyBlock
Browse files Browse the repository at this point in the history
  • Loading branch information
kostko committed Aug 25, 2020
1 parent 0e22082 commit 48735dd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions .changelog/3213.trivial.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
go/consensus/tendermint/apps/roothash: Clear timeout in emitEmptyBlock
7 changes: 7 additions & 0 deletions go/consensus/tendermint/apps/roothash/roothash.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,13 @@ func (app *rootHashApplication) emitEmptyBlock(ctx *tmapi.Context, runtime *root
runtime.CurrentBlock = blk
runtime.CurrentBlockHeight = ctx.BlockHeight()
if runtime.ExecutorPool != nil {
// Clear timeout if there was one scheduled.
if runtime.ExecutorPool.NextTimeout != commitment.TimeoutNever {
state := roothashState.NewMutableState(ctx.State())
if err := state.ClearRoundTimeout(ctx, runtime.Runtime.ID, runtime.ExecutorPool.NextTimeout); err != nil {
panic(fmt.Errorf("failed to clear round timeout: %w", err))
}
}
runtime.ExecutorPool.ResetCommitments()
}

Expand Down

0 comments on commit 48735dd

Please sign in to comment.