Browse Source

Fix lockup.

cl-refactor
Gav Wood 10 years ago
parent
commit
6bce6400ff
  1. 5
      libethcore/Common.cpp
  2. 16
      libethereum/Client.cpp
  3. 2
      libethereum/TransactionQueue.cpp

5
libethcore/Common.cpp

@ -36,11 +36,12 @@ namespace eth
{ {
const unsigned c_protocolVersion = 60; const unsigned c_protocolVersion = 60;
const unsigned c_minorProtocolVersion = 2;
#if ETH_FATDB #if ETH_FATDB
const unsigned c_databaseBaseVersion = 10; const unsigned c_minorProtocolVersion = 3;
const unsigned c_databaseBaseVersion = 9;
const unsigned c_databaseVersionModifier = 1; const unsigned c_databaseVersionModifier = 1;
#else #else
const unsigned c_minorProtocolVersion = 2;
const unsigned c_databaseBaseVersion = 9; const unsigned c_databaseBaseVersion = 9;
const unsigned c_databaseVersionModifier = 0; const unsigned c_databaseVersionModifier = 0;
#endif #endif

16
libethereum/Client.cpp

@ -461,13 +461,13 @@ ProofOfWork::WorkPackage Client::getWork()
bool Client::submitWork(ProofOfWork::Solution const& _solution) bool Client::submitWork(ProofOfWork::Solution const& _solution)
{ {
bytes newBlock; bytes newBlock;
DEV_TIMED(working) DEV_WRITE_GUARDED(x_working) DEV_WRITE_GUARDED(x_working)
if (!m_working.completeMine<ProofOfWork>(_solution)) if (!m_working.completeMine<ProofOfWork>(_solution))
return false; return false;
DEV_READ_GUARDED(x_working) DEV_READ_GUARDED(x_working)
{ {
DEV_TIMED(post) DEV_WRITE_GUARDED(x_postMine) DEV_WRITE_GUARDED(x_postMine)
m_postMine = m_working; m_postMine = m_working;
newBlock = m_working.blockData(); newBlock = m_working.blockData();
} }
@ -499,14 +499,14 @@ void Client::syncTransactionQueue()
h256Hash changeds; h256Hash changeds;
TransactionReceipts newPendingReceipts; TransactionReceipts newPendingReceipts;
DEV_TIMED(working) DEV_WRITE_GUARDED(x_working) DEV_WRITE_GUARDED(x_working)
tie(newPendingReceipts, m_syncTransactionQueue) = m_working.sync(m_bc, m_tq, *m_gp); tie(newPendingReceipts, m_syncTransactionQueue) = m_working.sync(m_bc, m_tq, *m_gp);
if (newPendingReceipts.empty()) if (newPendingReceipts.empty())
return; return;
DEV_READ_GUARDED(x_working) DEV_READ_GUARDED(x_working)
DEV_TIMED(post) DEV_WRITE_GUARDED(x_postMine) DEV_WRITE_GUARDED(x_postMine)
m_postMine = m_working; m_postMine = m_working;
DEV_READ_GUARDED(x_postMine) DEV_READ_GUARDED(x_postMine)
@ -574,7 +574,7 @@ void Client::onChainChanged(ImportRoute const& _ir)
DEV_WRITE_GUARDED(x_preMine) DEV_WRITE_GUARDED(x_preMine)
m_preMine = newPreMine; m_preMine = newPreMine;
DEV_TIMED(working) DEV_WRITE_GUARDED(x_working) DEV_WRITE_GUARDED(x_working)
m_working = newPreMine; m_working = newPreMine;
DEV_READ_GUARDED(x_postMine) DEV_READ_GUARDED(x_postMine)
for (auto const& t: m_postMine.pending()) for (auto const& t: m_postMine.pending())
@ -584,7 +584,7 @@ void Client::onChainChanged(ImportRoute const& _ir)
if (ir != ImportResult::Success) if (ir != ImportResult::Success)
onTransactionQueueReady(); onTransactionQueueReady();
} }
DEV_READ_GUARDED(x_working) DEV_TIMED(post) DEV_WRITE_GUARDED(x_postMine) DEV_READ_GUARDED(x_working) DEV_WRITE_GUARDED(x_postMine)
m_postMine = m_working; m_postMine = m_working;
changeds.insert(PendingChangedFilter); changeds.insert(PendingChangedFilter);
@ -609,11 +609,11 @@ void Client::onPostStateChanged()
cnote << "Post state changed: Restarting mining..."; cnote << "Post state changed: Restarting mining...";
if (isMining() || remoteActive()) if (isMining() || remoteActive())
{ {
DEV_TIMED(working) DEV_WRITE_GUARDED(x_working) DEV_WRITE_GUARDED(x_working)
m_working.commitToMine(m_bc); m_working.commitToMine(m_bc);
DEV_READ_GUARDED(x_working) DEV_READ_GUARDED(x_working)
{ {
DEV_TIMED(post) DEV_WRITE_GUARDED(x_postMine) DEV_WRITE_GUARDED(x_postMine)
m_postMine = m_working; m_postMine = m_working;
m_miningInfo = m_postMine.info(); m_miningInfo = m_postMine.info();
} }

2
libethereum/TransactionQueue.cpp

@ -187,7 +187,7 @@ bool TransactionQueue::remove_WITH_LOCK(h256 const& _txHash)
m_senders.erase(i); m_senders.erase(i);
break; break;
} }
cdebug << "=> nonce" << pit->second.nonce(); // cdebug << "=> nonce" << pit->second.nonce();
pool->erase(pit); pool->erase(pit);
return true; return true;
} }

Loading…
Cancel
Save