Browse Source

No need to commit to disk after successful mine - this will happen

during blockchain import anyway.
cl-refactor
Gav Wood 10 years ago
parent
commit
454d6118ca
  1. 18
      libethereum/Client.cpp
  2. 3
      libethereum/State.cpp

18
libethereum/Client.cpp

@ -289,14 +289,6 @@ void Client::connect(std::string const& _seedHost, unsigned short _port)
m_net->connect(_seedHost, _port);
}
void Client::onComplete(State& _s)
{
// Must lock stateDB here since we're actually pushing out to the database.
WriteGuard l(x_stateDB);
cwork << "COMPLETE MINE";
_s.completeMine();
}
void Client::setupState(State& _s)
{
{
@ -320,6 +312,14 @@ void Client::setupState(State& _s)
_s.commitToMine(m_bc);
}
void Client::onComplete(State& _s)
{
// Must lock stateDB here since we're actually pushing out to the database.
WriteGuard l(x_stateDB);
cwork << "COMPLETE MINE";
_s.completeMine();
}
void Client::transact(Secret _secret, u256 _value, Address _dest, bytes const& _data, u256 _gas, u256 _gasPrice)
{
ensureWorking();
@ -423,7 +423,7 @@ void Client::work()
cwork << "CHAIN <== postSTATE";
h256s hs;
{
ReadGuard l(x_stateDB);
WriteGuard l(x_stateDB);
hs = m_bc.attemptImport(m_miner.state().blockData(), m_stateDB);
}
if (hs.size())

3
libethereum/State.cpp

@ -767,9 +767,6 @@ void State::completeMine()
cdebug << "Completing mine!";
// Got it!
// Commit to disk.
m_db.commit();
// Compile block:
RLPStream ret;
ret.appendList(3);

Loading…
Cancel
Save