diff --git a/libethereum/State.cpp b/libethereum/State.cpp index a0d1a0e0e..4e9cd70bb 100644 --- a/libethereum/State.cpp +++ b/libethereum/State.cpp @@ -665,8 +665,8 @@ bytes const& State::code(Address _contract) const u256 State::execute(bytesConstRef _rlp) { - cnote << m_state.root() << m_state; - cnote << *this; +// cnote << m_state.root() << m_state; +// cnote << *this; Executive e(*this); e.setup(_rlp); @@ -680,9 +680,9 @@ u256 State::execute(bytesConstRef _rlp) commit(); - cnote << "Done TX"; - cnote << m_state.root() << m_state; - cnote << *this; +// cnote << "Done TX"; +// cnote << m_state.root() << m_state; +// cnote << *this; // Add to the user-originated transactions that we've executed. m_transactions.push_back(TransactionReceipt(e.t(), m_state.root(), startGasUSed + e.gasUsed())); diff --git a/libethereum/VM.h b/libethereum/VM.h index 79e193b65..1466e288a 100644 --- a/libethereum/VM.h +++ b/libethereum/VM.h @@ -97,6 +97,10 @@ template eth::bytesConstRef eth::VM::go(Ext& _ext, uint64_t _steps) runGas = 0; break; + case Instruction::SUICIDE: + runGas = 0; + break; + case Instruction::SSTORE: require(2); if (!_ext.store(m_stack.back()) && m_stack[m_stack.size() - 2]) @@ -148,7 +152,7 @@ template eth::bytesConstRef eth::VM::go(Ext& _ext, uint64_t _steps) case Instruction::CALL: require(7); - runGas = c_callGas + (unsigned)m_stack[m_stack.size() - 3]; + runGas = c_callGas + (unsigned)m_stack[m_stack.size() - 1]; newTempSize = std::max((unsigned)m_stack[m_stack.size() - 6] + (unsigned)m_stack[m_stack.size() - 7], (unsigned)m_stack[m_stack.size() - 4] + (unsigned)m_stack[m_stack.size() - 5]); break; @@ -529,12 +533,12 @@ template eth::bytesConstRef eth::VM::go(Ext& _ext, uint64_t _steps) { require(7); + u256 gas = m_stack.back(); + m_stack.pop_back(); u160 receiveAddress = asAddress(m_stack.back()); m_stack.pop_back(); u256 value = m_stack.back(); m_stack.pop_back(); - u256 gas = m_stack.back(); - m_stack.pop_back(); unsigned inOff = (unsigned)m_stack.back(); m_stack.pop_back(); @@ -545,11 +549,6 @@ template eth::bytesConstRef eth::VM::go(Ext& _ext, uint64_t _steps) unsigned outSize = (unsigned)m_stack.back(); m_stack.pop_back(); - if (!gas) - { - gas = m_gas; - m_gas = 0; - } if (_ext.balance(_ext.myAddress) >= value) { _ext.subBalance(value);