Always stop mining threads in RandomX dataset change upcoming.

This commit is contained in:
XMRig 2019-08-02 16:44:55 +07:00
parent bdaf28adf8
commit f7ea4b6dbd
5 changed files with 35 additions and 14 deletions

View file

@ -361,12 +361,18 @@ void xmrig::Miner::setEnabled(bool enabled)
void xmrig::Miner::setJob(const Job &job, bool donate)
{
d_ptr->algorithm = job.algorithm();
for (IBackend *backend : d_ptr->backends) {
backend->prepare(job);
}
# ifdef XMRIG_ALGO_RANDOMX
if (d_ptr->algorithm.family() == Algorithm::RANDOM_X && job.algorithm().family() == Algorithm::RANDOM_X && !Rx::isReady(job)) {
stop();
}
# endif
d_ptr->algorithm = job.algorithm();
uv_rwlock_wrlock(&d_ptr->rwlock);
const uint8_t index = donate ? 1 : 0;