From 922c7055b766de9b62a0fb7b17c691bd7c03b48c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Thu, 21 May 2015 10:26:12 +0200 Subject: [PATCH] Fix Executive::call(CallParameters). --- libethereum/Executive.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/libethereum/Executive.cpp b/libethereum/Executive.cpp index 0bf8bdbb5..ca7a5a38a 100644 --- a/libethereum/Executive.cpp +++ b/libethereum/Executive.cpp @@ -163,14 +163,12 @@ bool Executive::call(Address _receiveAddress, Address _codeAddress, Address _sen bool Executive::call(CallParameters const& _p, u256 const& _gasPrice, Address const& _origin) { m_isCreation = false; -// cnote << "Transferring" << formatBalance(_value) << "to receiver."; auto it = !(_p.codeAddress & ~h160(0xffffffff)) ? precompiled().find((unsigned)(u160)_p.codeAddress) : precompiled().end(); if (it != precompiled().end()) { bigint g = it->second.gas(_p.data); if (_p.gas < g) { - m_gas = 0; m_excepted = TransactionException::OutOfGasBase; // Bail from exception. return true; // true actually means "all finished - nothing more to be done regarding go(). @@ -182,14 +180,16 @@ bool Executive::call(CallParameters const& _p, u256 const& _gasPrice, Address co m_out = &m_precompiledOut; } } - else if (m_s.addressHasCode(_p.codeAddress)) - { - m_vm = VMFactory::create(); - bytes const& c = m_s.code(_p.codeAddress); - m_ext = make_shared(m_s, m_lastHashes, _p.receiveAddress, _p.senderAddress, _origin, _p.value, _gasPrice, _p.data, &c, m_depth); - } else + { m_gas = _p.gas; + if (m_s.addressHasCode(_p.codeAddress)) + { + m_vm = VMFactory::create(); + bytes const& c = m_s.code(_p.codeAddress); + m_ext = make_shared(m_s, m_lastHashes, _p.receiveAddress, _p.senderAddress, _origin, _p.value, _gasPrice, _p.data, &c, m_depth); + } + } m_s.transferBalance(_p.senderAddress, _p.receiveAddress, _p.value);