diff options
author | Riccardo Spagni <ric@spagni.net> | 2018-02-20 17:47:03 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2018-02-20 17:47:03 +0200 |
commit | ff36fd93fde69939e9305b93a83f38332a144194 (patch) | |
tree | 3d476a49c1109381b491708562105ef26d9d36ad /src | |
parent | Merge pull request #3254 (diff) | |
parent | Closes #2886: really ignore battery checking (diff) | |
download | monero-ff36fd93fde69939e9305b93a83f38332a144194.tar.xz |
Merge pull request #3255
3962bcb2 Closes #2886: really ignore battery checking (Timothy D. Prime)
Diffstat (limited to 'src')
-rw-r--r-- | src/cryptonote_basic/miner.cpp | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/cryptonote_basic/miner.cpp b/src/cryptonote_basic/miner.cpp index b322383a9..919872709 100644 --- a/src/cryptonote_basic/miner.cpp +++ b/src/cryptonote_basic/miner.cpp @@ -624,21 +624,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 ) { |