mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-08 07:58:40 +00:00
core: more fixes
This commit is contained in:
parent
b1daa4432c
commit
c3d51efe2d
1 changed files with 6 additions and 1 deletions
|
|
@ -280,6 +280,11 @@ func (evm *EVM) Call(caller common.Address, addr common.Address, input []byte, g
|
|||
}
|
||||
evm.StateDB.CreateAccount(addr)
|
||||
}
|
||||
if evm.chainRules.IsAmsterdam {
|
||||
// Compute state changed bytes for account creation.
|
||||
evm.StateDB.StateChangedBytes(snapshot)
|
||||
}
|
||||
innerSnapshot := evm.StateDB.Snapshot()
|
||||
// Perform the value transfer only in non-syscall mode.
|
||||
// Calling this is required even for zero-value transfers,
|
||||
// to ensure the state clearing mechanism is applied.
|
||||
|
|
@ -319,7 +324,7 @@ func (evm *EVM) Call(caller common.Address, addr common.Address, input []byte, g
|
|||
// evm.StateDB.DiscardSnapshot(snapshot)
|
||||
} else if evm.chainRules.IsAmsterdam {
|
||||
// Charge state costs
|
||||
bytesCharged := evm.StateDB.StateChangedBytes(snapshot)
|
||||
bytesCharged := evm.StateDB.StateChangedBytes(innerSnapshot)
|
||||
stateGasCost := GasCosts{StateGas: bytesCharged * int64(evm.Context.CostPerStateByte)}
|
||||
if !gas.CanAfford(stateGasCost) {
|
||||
gas.Exhaust()
|
||||
|
|
|
|||
Loading…
Reference in a new issue