From 52bb88b88a358310967466cc792c7783d82beb48 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Tue, 6 May 2014 20:09:35 +0100 Subject: [PATCH] Updates to contract creation code. --- libethereum/State.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/libethereum/State.cpp b/libethereum/State.cpp index cc5704d46..d8321a20a 100644 --- a/libethereum/State.cpp +++ b/libethereum/State.cpp @@ -916,16 +916,10 @@ h160 State::create(Address _sender, u256 _endowment, u256 _gasPrice, u256* _gas, if (revert) evm.revert(); - // Kill contract if there's no code. - if (out.empty()) - { - m_cache.erase(newAddress); - newAddress = Address(); - } - else + // Set code as long as we didn't suicide. + if (addressInUse(newAddress)) m_cache[newAddress].setCode(out); - *_gas = vm.gas(); return newAddress;