Browse Source

Fix importing.

cl-refactor
Gav Wood 9 years ago
parent
commit
7a0f3350b6
  1. 1
      eth/main.cpp
  2. 1
      libethereum/BlockQueue.cpp
  3. 3
      libethereum/Client.cpp

1
eth/main.cpp

@ -827,6 +827,7 @@ int main(int argc, char** argv)
cout << i << " more imported at " << (round(i * 10 / d) / 10) << " blocks/s. " << imported << " imported in " << e << " seconds at " << (round(imported * 10 / e) / 10) << " blocks/s (#" << web3.ethereum()->number() << ")" << endl;
last = (unsigned)e;
lastImported = imported;
// cout << web3.ethereum()->blockQueueStatus() << endl;
}
}

1
libethereum/BlockQueue.cpp

@ -181,6 +181,7 @@ void BlockQueue::verifierBody()
ImportResult BlockQueue::import(bytesConstRef _block, BlockChain const& _bc, bool _isOurs)
{
cdebug << std::this_thread::get_id();
// Check if we already know this block.
h256 h = BlockInfo::headerHash(_block);

3
libethereum/Client.cpp

@ -89,13 +89,14 @@ void VersionChecker::setOk()
ImportResult Client::queueBlock(bytes const& _block, bool _isSafe)
{
if (m_bq.status().verified + m_bq.status().verifying + m_bq.status().unverified > 30000)
if (m_bq.status().verified + m_bq.status().verifying + m_bq.status().unverified > 500)
this_thread::sleep_for(std::chrono::milliseconds(500));
return m_bq.import(&_block, bc(), _isSafe);
}
tuple<ImportRoute, bool, unsigned> Client::syncQueue(unsigned _max)
{
stopWorking();
return m_bc.sync(m_bq, m_stateDB, _max);
}

Loading…
Cancel
Save