Skip to content

Commit

Permalink
eth/tracers: fix release issue
Browse files Browse the repository at this point in the history
  • Loading branch information
rjl493456442 committed Aug 22, 2022
1 parent 30eec19 commit 7be3326
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions eth/tracers/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -381,12 +381,17 @@ func (api *API) traceChain(start, end *types.Block, config *TraceConfig, closed
logged = time.Now()
log.Info("Tracing chain segment", "start", start.NumberU64(), "end", end.NumberU64(), "current", number, "transactions", traced, "elapsed", time.Since(begin))
}
// Retrieve the parent state to trace on top
// Retrieve the parent block and target block for tracing.
block, err := api.blockByNumber(ctx, rpc.BlockNumber(number))
if err != nil {
failed = err
break
}
next, err := api.blockByNumber(ctx, rpc.BlockNumber(number+1))
if err != nil {
failed = err
break
}
// Prepare the statedb for tracing. Don't use the live database for
// tracing to avoid persisting state junks into the database. Switch
// over to `preferDisk` mode only if the memory usage exceeds the
Expand All @@ -402,11 +407,6 @@ func (api *API) traceChain(start, end *types.Block, config *TraceConfig, closed
failed = err
break
}
next, err := api.blockByNumber(ctx, rpc.BlockNumber(number+1))
if err != nil {
failed = err
break
}
// Clean out any pending derefs. Note this step must be done after
// constructing tracing state, because the tracing state of block
// next depends on the parent state and construction may fail if
Expand Down

0 comments on commit 7be3326

Please sign in to comment.