|
|
@@ -299,9 +299,6 @@ func (evm *EVM) StaticCall(caller ContractRef, addr common.Address, input []byte
|
|
|
|
|
|
// Create creates a new contract using code as deployment code.
|
|
|
func (evm *EVM) Create(caller ContractRef, code []byte, gas uint64, value *big.Int) (ret []byte, contractAddr common.Address, leftOverGas uint64, err error) {
|
|
|
- if evm.vmConfig.NoRecursion && evm.depth > 0 {
|
|
|
- return nil, common.Address{}, gas, nil
|
|
|
- }
|
|
|
|
|
|
// Depth check execution. Fail if we're trying to execute above the
|
|
|
// limit.
|
|
|
@@ -334,6 +331,9 @@ func (evm *EVM) Create(caller ContractRef, code []byte, gas uint64, value *big.I
|
|
|
contract := NewContract(caller, AccountRef(contractAddr), value, gas)
|
|
|
contract.SetCallCode(&contractAddr, crypto.Keccak256Hash(code), code)
|
|
|
|
|
|
+ if evm.vmConfig.NoRecursion && evm.depth > 0 {
|
|
|
+ return nil, contractAddr, gas, nil
|
|
|
+ }
|
|
|
ret, err = run(evm, snapshot, contract, nil)
|
|
|
// check whether the max code size has been exceeded
|
|
|
maxCodeSizeExceeded := evm.ChainConfig().IsEIP158(evm.BlockNumber) && len(ret) > params.MaxCodeSize
|