aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_basic/miner.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/cryptonote_basic/miner.cpp')
-rw-r--r--src/cryptonote_basic/miner.cpp18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/cryptonote_basic/miner.cpp b/src/cryptonote_basic/miner.cpp
index b322383a9..7af9b3487 100644
--- a/src/cryptonote_basic/miner.cpp
+++ b/src/cryptonote_basic/miner.cpp
@@ -602,7 +602,7 @@ namespace cryptonote
// this should take care of the case where mining is started with bg-enabled,
// and then the user decides to un-check background mining, and just do
// regular full-speed mining. I might just be over-doing it and thinking up
- // non-existant use-cases, so if the concensus is to simplify, we can remove all this fluff.
+ // non-existant use-cases, so if the consensus is to simplify, we can remove all this fluff.
/*
while( !m_is_background_mining_enabled )
{
@@ -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 )
{