Skip to content

Commit 7d59c5c

Browse files
committed
eth: fixed tracing functions using the current header instead of parent
Fixes #2525
1 parent 8aa4597 commit 7d59c5c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

eth/api.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1841,15 +1841,15 @@ func (s *PrivateDebugAPI) TraceTransaction(txHash common.Hash, logger *vm.LogCon
18411841
}
18421842
// Mutate the state if we haven't reached the tracing transaction yet
18431843
if uint64(idx) < txIndex {
1844-
vmenv := core.NewEnv(stateDb, s.config, s.eth.BlockChain(), msg, parent.Header(), vm.Config{})
1844+
vmenv := core.NewEnv(stateDb, s.config, s.eth.BlockChain(), msg, block.Header(), vm.Config{})
18451845
_, _, err := core.ApplyMessage(vmenv, msg, new(core.GasPool).AddGas(tx.Gas()))
18461846
if err != nil {
18471847
return nil, fmt.Errorf("mutation failed: %v", err)
18481848
}
18491849
continue
18501850
}
18511851
// Otherwise trace the transaction and return
1852-
vmenv := core.NewEnv(stateDb, s.config, s.eth.BlockChain(), msg, parent.Header(), vm.Config{Debug: true, Logger: *logger})
1852+
vmenv := core.NewEnv(stateDb, s.config, s.eth.BlockChain(), msg, block.Header(), vm.Config{Debug: true, Logger: *logger})
18531853
ret, gas, err := core.ApplyMessage(vmenv, msg, new(core.GasPool).AddGas(tx.Gas()))
18541854
if err != nil {
18551855
return nil, fmt.Errorf("tracing failed: %v", err)

0 commit comments

Comments
 (0)