MCPcopy Create free account
hub / github.com/LUX-Core/lux / doWork

Method doWork

src/cpp-ethereum/libethereum/Client.cpp:667–701  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

665}
666
667void Client::doWork(bool _doWait)
668{
669 bool t = true;
670 if (m_syncBlockQueue.compare_exchange_strong(t, false))
671 syncBlockQueue();
672
673 if (m_needStateReset)
674 {
675 resetState();
676 m_needStateReset = false;
677 }
678
679 t = true;
680 bool isSealed = false;
681 DEV_READ_GUARDED(x_working)
682 isSealed = m_working.isSealed();
683 if (!isSealed && !isSyncing() && !m_remoteWorking && m_syncTransactionQueue.compare_exchange_strong(t, false))
684 syncTransactionQueue();
685
686 tick();
687
688 rejigSealing();
689
690 callQueuedFunctions();
691
692 DEV_READ_GUARDED(x_working)
693 isSealed = m_working.isSealed();
694 // If the block is sealed, we have to wait for it to tickle through the block queue
695 // (which only signals as wanting to be synced if it is ready).
696 if (!m_syncBlockQueue && !m_syncTransactionQueue && (_doWait || isSealed))
697 {
698 std::unique_lock<std::mutex> l(x_signalled);
699 m_signalled.wait_for(l, chrono::seconds(1));
700 }
701}
702
703void Client::tick()
704{

Callers

nothing calls this directly

Calls 3

isSealedMethod · 0.80
DEV_READ_GUARDEDFunction · 0.70
wait_forMethod · 0.45

Tested by

no test coverage detected