Skip to content

Commit

Permalink
eth/tracers: avoid data race when tracing block with bor tx (#1214)
Browse files Browse the repository at this point in the history
  • Loading branch information
easyfold authored May 3, 2024
1 parent 7e2be02 commit 3a719a8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions eth/tracers/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -835,8 +835,10 @@ func (api *API) traceBlock(ctx context.Context, block *types.Block, config *Trac

if stateSyncPresent && task.index == len(txs)-1 {
if *config.BorTraceEnabled {
config.BorTx = newBoolPtr(true)
res, err = api.traceTx(ctx, msg, txctx, blockCtx, task.statedb, config)
// avoid data race
newConfig := *config
newConfig.BorTx = newBoolPtr(true)
res, err = api.traceTx(ctx, msg, txctx, blockCtx, task.statedb, &newConfig)
} else {
break
}
Expand Down

0 comments on commit 3a719a8

Please sign in to comment.