aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_basic
diff options
context:
space:
mode:
authorTimothy D. Prime <tdprime@teleosmedia.com>2018-02-12 10:29:22 -0800
committerTimothy D. Prime <tdprime@teleosmedia.com>2018-02-12 10:29:22 -0800
commit3962bcb2a2d2137b766353a0a7dd424b4e3fe213 (patch)
treeaf4774be4c70438aa04dd44bd488976c2fa116c3 /src/cryptonote_basic
parentMerge pull request #3115 (diff)
downloadmonero-3962bcb2a2d2137b766353a0a7dd424b4e3fe213.tar.xz
Closes #2886: really ignore battery checking
Move option test first.
Diffstat (limited to 'src/cryptonote_basic')
-rw-r--r--src/cryptonote_basic/miner.cpp16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/cryptonote_basic/miner.cpp b/src/cryptonote_basic/miner.cpp
index 670baea50..4df28365e 100644
--- a/src/cryptonote_basic/miner.cpp
+++ b/src/cryptonote_basic/miner.cpp
@@ -623,21 +623,15 @@ namespace cryptonote
continue; // if interrupted because stop called, loop should end ..
}
- boost::tribool battery_powered(on_battery_power());
- bool on_ac_power = false;
- if(indeterminate( battery_powered ))
+ bool on_ac_power = m_ignore_battery;
+ if(!m_ignore_battery)
{
- // name could be better, only ignores battery requirement if we failed
- // to get the status of the system
- if( m_ignore_battery )
+ boost::tribool battery_powered(on_battery_power());
+ if(!indeterminate( battery_powered ))
{
- on_ac_power = true;
+ on_ac_power = !battery_powered;
}
}
- else
- {
- on_ac_power = !battery_powered;
- }
if( m_is_background_mining_started )
{