mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 07:06:42 +00:00
eth/tracers: avoid data race when tracing block with bor tx (#1214)
This commit is contained in:
parent
7e2be02c26
commit
3a719a86d1
1 changed files with 4 additions and 2 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue