mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 02:12:23 +00:00
core: remove past fork checking
This commit is contained in:
parent
918aaba346
commit
aa54c6d181
1 changed files with 4 additions and 10 deletions
|
|
@ -673,19 +673,13 @@ func opCreate2(pc *uint64, evm *EVM, contract *Contract, memory *Memory, stack *
|
||||||
input = memory.Get(offset.Int64(), size.Int64())
|
input = memory.Get(offset.Int64(), size.Int64())
|
||||||
gas = contract.Gas
|
gas = contract.Gas
|
||||||
)
|
)
|
||||||
if evm.ChainConfig().IsEIP150(evm.BlockNumber) {
|
|
||||||
gas -= gas / 64
|
|
||||||
}
|
|
||||||
|
|
||||||
|
// Apply EIP150
|
||||||
|
gas -= gas / 64
|
||||||
contract.UseGas(gas)
|
contract.UseGas(gas)
|
||||||
res, addr, returnGas, suberr := evm.Create2(contract, input, gas, endowment, salt)
|
res, addr, returnGas, suberr := evm.Create2(contract, input, gas, endowment, salt)
|
||||||
// Push item on the stack based on the returned error. If the ruleset is
|
// Push item on the stack based on the returned error.
|
||||||
// homestead we must check for CodeStoreOutOfGasError (homestead only
|
if suberr != nil {
|
||||||
// rule) and treat as an error, if the ruleset is frontier we must
|
|
||||||
// ignore this error and pretend the operation was successful.
|
|
||||||
if evm.ChainConfig().IsHomestead(evm.BlockNumber) && suberr == ErrCodeStoreOutOfGas {
|
|
||||||
stack.push(evm.interpreter.intPool.getZero())
|
|
||||||
} else if suberr != nil && suberr != ErrCodeStoreOutOfGas {
|
|
||||||
stack.push(evm.interpreter.intPool.getZero())
|
stack.push(evm.interpreter.intPool.getZero())
|
||||||
} else {
|
} else {
|
||||||
stack.push(addr.Big())
|
stack.push(addr.Big())
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue