mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-08 13:03:47 +00:00
Fixed wrong EVM call tracing code
This commit is contained in:
parent
b797e5d261
commit
5952799988
1 changed files with 6 additions and 3 deletions
|
|
@ -408,10 +408,14 @@ func (evm *EVM) create(caller ContractRef, codeAndHash *codeAndHash, gas uint64,
|
|||
if tracer := evm.Config.Tracer; tracer != nil {
|
||||
if evm.depth == 0 {
|
||||
tracer.CaptureStart(caller.Address(), address, true, codeAndHash.code, gas, value)
|
||||
defer tracer.CaptureEnd(ret, gas-leftOverGas, err)
|
||||
defer func(startGas uint64) {
|
||||
tracer.CaptureEnd(ret, startGas-leftOverGas, err)
|
||||
}(gas)
|
||||
} else {
|
||||
tracer.CaptureEnter(typ, caller.Address(), address, codeAndHash.code, gas, value)
|
||||
defer tracer.CaptureExit(ret, gas-leftOverGas, err)
|
||||
defer func(startGas uint64) {
|
||||
tracer.CaptureExit(ret, startGas-leftOverGas, err)
|
||||
}(gas)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -486,7 +490,6 @@ func (evm *EVM) create(caller ContractRef, codeAndHash *codeAndHash, gas uint64,
|
|||
}
|
||||
}
|
||||
|
||||
leftOverGas = contract.Gas
|
||||
return ret, address, contract.Gas, err
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue