aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_basic/miner.cpp
diff options
context:
space:
mode:
authorDion Ahmetaj <Dion Ahmetaj>2017-02-08 16:17:50 -0500
committerDion Ahmetaj <Dion Ahmetaj>2017-02-10 18:07:43 -0500
commitad95e65028302c151546e49698284fdf48727c6d (patch)
tree5f543e906da88c41936ae279c63e96ebb5909435 /src/cryptonote_basic/miner.cpp
parentChanged ac_line_status to on_battery_power. (diff)
downloadmonero-ad95e65028302c151546e49698284fdf48727c6d.tar.xz
Added a note about smart mining to status command. Fixed up a bug where I was resetting bg mining enabled instead of started. Upped the miner threshold. Also moved setting of enabled on start above miner thread creation since starting with true, then stopping, then starting with false resulted in race condition.
Diffstat (limited to '')
-rw-r--r--src/cryptonote_basic/miner.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/cryptonote_basic/miner.cpp b/src/cryptonote_basic/miner.cpp
index 145cb185f..117c81878 100644
--- a/src/cryptonote_basic/miner.cpp
+++ b/src/cryptonote_basic/miner.cpp
@@ -277,7 +277,8 @@ namespace cryptonote
boost::interprocess::ipcdetail::atomic_write32(&m_stop, 0);
boost::interprocess::ipcdetail::atomic_write32(&m_thread_index, 0);
-
+ set_is_background_mining_enabled(do_background);
+
for(size_t i = 0; i != threads_count; i++)
{
m_threads.push_back(boost::thread(attrs, boost::bind(&miner::worker_thread, this)));
@@ -285,7 +286,6 @@ namespace cryptonote
LOG_PRINT_L0("Mining has started with " << threads_count << " threads, good luck!" );
- set_is_background_mining_enabled(do_background);
if( get_is_background_mining_enabled() )
{
m_background_mining_thread = boost::thread(attrs, boost::bind(&miner::background_worker_thread, this));
@@ -526,7 +526,7 @@ namespace cryptonote
uint64_t prev_total_time, current_total_time;
uint64_t prev_idle_time, current_idle_time;
uint64_t previous_process_time = 0, current_process_time = 0;
- m_is_background_mining_enabled = false;
+ m_is_background_mining_started = false;
if(!get_system_times(prev_total_time, prev_idle_time))
{