diff --git a/src/CryptoNoteCore/Miner.cpp b/src/CryptoNoteCore/Miner.cpp index f076af30d6..2e5427af59 100644 --- a/src/CryptoNoteCore/Miner.cpp +++ b/src/CryptoNoteCore/Miner.cpp @@ -282,9 +282,17 @@ namespace CryptoNote //----------------------------------------------------------------------------------------------------- bool miner::stop() { - send_stop_signal(); std::lock_guard lk(m_threads_lock); + bool mining = !m_threads.empty(); + if (!mining) + { + logger(TRACE) << "Not mining - nothing to stop"; + return true; + } + + send_stop_signal(); + for (auto& th : m_threads) { th.join(); }