Skip to content

Commit

Permalink
handle no block to iterate
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangchiqing committed Jan 31, 2025
1 parent 706a984 commit 2a843a5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion engine/execution/pruner/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,16 @@ func LoopPruneExecutionDataFromRootToLatestSealed(
case <-time.After(config.SleepAfterEachIteration):
}

iter, err := creator.Create()
iter, hasNext, err := creator.Create()
if err != nil {
return fmt.Errorf("failed to create block iterator: %w", err)
}

if !hasNext {
// no more blocks to iterate, we are done.
continue
}

err = iterateAndPruneAll(iter)
if err != nil {
return fmt.Errorf("failed to iterate, execute, and commit in batch: %w", err)
Expand Down

0 comments on commit 2a843a5

Please sign in to comment.