Browse Source

Avoid noting safe exceptions unless the user *really* wants it.

cl-refactor
Gav Wood 10 years ago
parent
commit
761bd33123
  1. 13
      libethereum/Executive.cpp
  2. 1
      libethereum/State.h

13
libethereum/Executive.cpp

@ -166,8 +166,9 @@ bool Executive::go(OnOpFunc const& _onOp)
{
if (m_vm)
{
#if ETH_TIMED_EXECUTIONS
boost::timer t;
// auto sgas = m_vm->gas();
#endif
try
{
m_out = m_vm->go(*m_ext, _onOp);
@ -188,11 +189,9 @@ bool Executive::go(OnOpFunc const& _onOp)
}
catch (VMException const& _e)
{
clog(StateChat) << "Safe VM Exception";
m_endGas = 0;//m_vm->gas();
clog(StateSafeExceptions) << "Safe VM Exception. " << diagnostic_information(_e);
m_endGas = 0;
m_excepted = true;
// Write state out only in the case of a non-excepted transaction.
m_ext->revert();
}
catch (Exception const& _e)
@ -205,7 +204,9 @@ bool Executive::go(OnOpFunc const& _onOp)
// TODO: AUDIT: check that this can never reasonably happen. Consider what to do if it does.
cwarn << "Unexpected std::exception in VM. This is probably unrecoverable. " << _e.what();
}
// cnote << "VM took:" << t.elapsed() << "; gas used: " << (sgas - m_endGas);
#if ETH_TIMED_EXECUTIONS
cnote << "VM took:" << t.elapsed() << "; gas used: " << (sgas - m_endGas);
#endif
}
return true;
}

1
libethereum/State.h

@ -51,6 +51,7 @@ class BlockChain;
struct StateChat: public LogChannel { static const char* name() { return "-S-"; } static const int verbosity = 4; };
struct StateTrace: public LogChannel { static const char* name() { return "=S="; } static const int verbosity = 7; };
struct StateDetail: public LogChannel { static const char* name() { return "/S/"; } static const int verbosity = 14; };
struct StateSafeExceptions: public LogChannel { static const char* name() { return "(S)"; } static const int verbosity = 21; };
struct PrecompiledAddress
{

Loading…
Cancel
Save