From 56e28731f86187286befe7239881a54846ad221e Mon Sep 17 00:00:00 2001 From: Sergiy Lavrynenko Date: Fri, 28 Aug 2020 08:44:44 +0300 Subject: [PATCH] SKALE-3135 shutdown Skale Host inside Ethereum Client early as possible --- libethereum/Client.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/libethereum/Client.cpp b/libethereum/Client.cpp index 1c06f9da8..efa48aea4 100644 --- a/libethereum/Client.cpp +++ b/libethereum/Client.cpp @@ -125,8 +125,11 @@ Client::~Client() { void Client::stopWorking() { Worker::stopWorking(); - if ( m_snapshotHashComputing != nullptr ) - m_snapshotHashComputing->join(); + if ( m_skaleHost ) + m_skaleHost->stopWorking(); // TODO Find and document a systematic way to sart/stop all + // workers + else + cerror << "Instance of SkaleHost was not properly created."; if ( m_snapshotHashComputing != nullptr ) { try { @@ -139,12 +142,6 @@ void Client::stopWorking() { m_new_block_watch.uninstallAll(); m_new_pending_transaction_watch.uninstallAll(); - if ( m_skaleHost ) - m_skaleHost->stopWorking(); // TODO Find and document a systematic way to sart/stop all - // workers - else - cerror << "Instance of SkaleHost was not properly created."; - m_signalled.notify_all(); // to wake up the thread from Client::doWork() m_tq.HandleDestruction(); // l_sergiy: destroy transaction queue earlier