From 7ced86ec09ac712cd02c2ea10ccda4ea50aed98a Mon Sep 17 00:00:00 2001 From: Yoichi Hirai Date: Tue, 10 Apr 2018 10:29:43 +0200 Subject: [PATCH] Worker thread of Client class should not sleep when stopping https://github.com/ethereum/cpp-ethereum/pull/4948/files#r180332663 When there is a request to stop the thread, the thread should not enter the sleeping state to wait for something else. --- libethereum/Client.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libethereum/Client.cpp b/libethereum/Client.cpp index 3298755817d..3b61a32c76a 100644 --- a/libethereum/Client.cpp +++ b/libethereum/Client.cpp @@ -693,7 +693,7 @@ void Client::doWork(bool _doWait) isSealed = m_working.isSealed(); // If the block is sealed, we have to wait for it to tickle through the block queue // (which only signals as wanting to be synced if it is ready). - if (!m_syncBlockQueue && !m_syncTransactionQueue && (_doWait || isSealed)) + if (!m_syncBlockQueue && !m_syncTransactionQueue && (_doWait || isSealed) && isWorking()) { std::unique_lock l(x_signalled); m_signalled.wait_for(l, chrono::seconds(1));