Browse Source

STOP is free.

Fixed dodgy txcounts.
cl-refactor
Gav Wood 11 years ago
parent
commit
86c0487cf0
  1. 5
      libethereum/State.cpp
  2. 4
      libethereum/VM.h

5
libethereum/State.cpp

@ -723,7 +723,7 @@ bool State::call(Address _receiveAddress, Address _sendAddress, u256 _value, u25
h160 State::create(Address _sender, u256 _endowment, u256 _gasPrice, u256* _gas, bytesConstRef _code, bytesConstRef _init)
{
Address newAddress = left160(sha3(rlpList(_sender, transactionsFrom(_sender))));
Address newAddress = left160(sha3(rlpList(_sender, transactionsFrom(_sender) - 1)));
while (isContractAddress(newAddress) || isNormalAddress(newAddress))
newAddress = (u160)newAddress + 1;
@ -735,9 +735,6 @@ h160 State::create(Address _sender, u256 _endowment, u256 _gasPrice, u256* _gas,
ExtVM evm(*this, newAddress, _sender, _endowment, _gasPrice, bytesConstRef(), _init);
bool revert = false;
// Increment associated nonce for sender.
noteSending(_sender);
try
{
/*auto out =*/ vm.go(evm);

4
libethereum/VM.h

@ -93,6 +93,10 @@ template <class Ext> eth::bytesConstRef eth::VM::go(Ext& _ext, uint64_t _steps)
unsigned newTempSize = (unsigned)m_temp.size();
switch (inst)
{
case Instruction::STOP:
runGas = 0;
break;
case Instruction::SSTORE:
require(2);
if (!_ext.store(m_stack.back()) && m_stack[m_stack.size() - 2])

Loading…
Cancel
Save