Skip to content

Commit

Permalink
SKALE-3135 shutdown Skale Host inside Ethereum Client early as possible
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiy-skalelabs committed Aug 28, 2020
1 parent 8d6b1e5 commit 56e2873
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions libethereum/Client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
Expand Down

0 comments on commit 56e2873

Please sign in to comment.