Skip to content

Commit

Permalink
Not mining - nothing to stop
Browse files Browse the repository at this point in the history
  • Loading branch information
aivve committed Feb 9, 2022
1 parent 662d33f commit 10282bf
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/CryptoNoteCore/Miner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,9 +282,17 @@ namespace CryptoNote
//-----------------------------------------------------------------------------------------------------
bool miner::stop()
{
send_stop_signal();
std::lock_guard<std::mutex> 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();
}
Expand Down

0 comments on commit 10282bf

Please sign in to comment.