Merge pull request #3255

3962bcb2 Closes #2886: really ignore battery checking (Timothy D. Prime)
This commit is contained in:
Riccardo Spagni 2018-02-20 17:47:03 +02:00
commit ff36fd93fd
No known key found for this signature in database
GPG Key ID: 55432DF31CCD4FCD
1 changed files with 5 additions and 11 deletions

View File

@ -624,21 +624,15 @@ namespace cryptonote
continue; // if interrupted because stop called, loop should end ..
}
bool on_ac_power = m_ignore_battery;
if(!m_ignore_battery)
{
boost::tribool battery_powered(on_battery_power());
bool on_ac_power = false;
if(indeterminate( battery_powered ))
{
// name could be better, only ignores battery requirement if we failed
// to get the status of the system
if( m_ignore_battery )
{
on_ac_power = true;
}
}
else
if(!indeterminate( battery_powered ))
{
on_ac_power = !battery_powered;
}
}
if( m_is_background_mining_started )
{