Merge pull request #2122 from SChernykh/dev

Fixed pause logic when both pause on battery and user activity are en…
This commit is contained in:
xmrig 2021-02-21 22:36:32 +07:00 committed by GitHub
commit 31a5d05dc1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -354,6 +354,7 @@ public:
bool battery_power = false;
bool user_active = false;
bool enabled = true;
int32_t auto_pause = 0;
bool reset = true;
Controller *controller;
Job job;
@ -635,7 +636,8 @@ void xmrig::Miner::onTimer(const Timer *)
LOG_INFO("%s %s", Tags::miner(), pause ? pauseMessage : activeMessage);
state = pause;
setEnabled(!pause);
d_ptr->auto_pause += pause ? 1 : -1;
setEnabled(d_ptr->auto_pause == 0);
}
};