@@ -604,7 +604,6 @@ func (api *API) traceBlock(ctx context.Context, block *types.Block, config *Trac
604604 if threads > len (txs ) {
605605 threads = len (txs )
606606 }
607- blockCtx := core .NewEVMBlockContext (block .Header (), api .chainContext (ctx ), nil )
608607 blockHash := block .Hash ()
609608 for th := 0 ; th < threads ; th ++ {
610609 pend .Add (1 )
@@ -618,6 +617,7 @@ func (api *API) traceBlock(ctx context.Context, block *types.Block, config *Trac
618617 TxIndex : task .index ,
619618 TxHash : txs [task .index ].Hash (),
620619 }
620+ blockCtx := core .NewEVMBlockContext (block .Header (), api .chainContext (ctx ), nil )
621621 res , err := api .traceTx (ctx , msg , txctx , blockCtx , task .statedb , config )
622622 if err != nil {
623623 results [task .index ] = & txTraceResult {Error : err .Error ()}
@@ -647,6 +647,7 @@ func (api *API) traceBlock(ctx context.Context, block *types.Block, config *Trac
647647 }
648648
649649 statedb .Prepare (tx .Hash (), block .Hash (), i )
650+ blockCtx := core .NewEVMBlockContext (block .Header (), api .chainContext (ctx ), nil )
650651 vmenv := vm .NewEVM (blockCtx , core .NewEVMTxContext (msg ), statedb , api .backend .ChainConfig (), vm.Config {})
651652 if _ , err := core .ApplyMessage (vmenv , msg , new (core.GasPool ).AddGas (msg .Gas ())); err != nil {
652653 failed = err
0 commit comments