diff --git a/libethereum/Executive.cpp b/libethereum/Executive.cpp index f79bb4a3b..c4ce543d6 100644 --- a/libethereum/Executive.cpp +++ b/libethereum/Executive.cpp @@ -146,9 +146,17 @@ bool Executive::create(Address _sender, u256 _endowment, u256 _gasPrice, u256 _g m_s.m_cache[m_newAddress] = Account(m_s.balance(m_newAddress) + _endowment, Account::ContractConception); // Execute _init. - m_vm = VMFactory::create(_gas); - m_ext = make_shared(m_s, m_lastHashes, m_newAddress, _sender, _origin, _endowment, _gasPrice, bytesConstRef(), _init, m_depth); - return _init.empty(); + if (_init.empty()) + { + m_s.m_cache[m_newAddress].setCode({}); + m_endGas = _gas; + } + else + { + m_vm = VMFactory::create(_gas); + m_ext = make_shared(m_s, m_lastHashes, m_newAddress, _sender, _origin, _endowment, _gasPrice, bytesConstRef(), _init, m_depth); + } + return !m_ext; } OnOpFunc Executive::simpleTrace()