Add check to have pre-Homestead behavior on code store error (#2749)

* Add check to have pre-Homestead behavior on code store error

* Fix linter error
This commit is contained in:
canepat 2021-10-01 07:24:48 +02:00 committed by GitHub
parent 2afd028d3d
commit e19dcd89fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -553,7 +553,7 @@ func (evm *EVM) create(caller ContractRef, codeAndHash *codeAndHash, gas uint64,
createDataGas := uint64(len(ret)) * params.CreateDataGas
if contract.UseGas(createDataGas) {
evm.IntraBlockState.SetCode(address, ret)
} else {
} else if evm.ChainRules.IsHomestead {
err = ErrCodeStoreOutOfGas
}
}