mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-08 07:58:40 +00:00
core: fix collisions
This commit is contained in:
parent
d55c8f41d7
commit
6c1c599804
1 changed files with 5 additions and 3 deletions
|
|
@ -544,10 +544,12 @@ func (evm *EVM) create(caller common.Address, code []byte, gas GasBudget, value
|
|||
if evm.Config.Tracer != nil && evm.Config.Tracer.OnGasChange != nil {
|
||||
evm.Config.Tracer.OnGasChange(gas.RegularGas, 0, tracing.GasChangeCallFailedExecution)
|
||||
}
|
||||
// Record all burned gas
|
||||
burned := gas.RegularGas
|
||||
// Drain the entire budget on collision
|
||||
gas.Exhaust()
|
||||
return nil, common.Address{}, gas, GasUsed{RegularGas: burned}, ErrContractAddressCollision
|
||||
if evm.chainRules.IsAmsterdam {
|
||||
gas.StateGas = 0
|
||||
}
|
||||
return nil, common.Address{}, gas, GasUsed{}, ErrContractAddressCollision
|
||||
}
|
||||
// Create a new account on the state only if the object was not present.
|
||||
// It might be possible the contract code is deployed to a pre-existent
|
||||
|
|
|
|||
Loading…
Reference in a new issue