Updated version

This commit is contained in:
MoneroOcean 2019-08-03 10:07:13 -07:00
commit 3050fa219a
23 changed files with 284 additions and 251 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;
@ -380,7 +386,7 @@ void xmrig::Miner::setJob(const Job &job, bool donate)
}
# ifdef XMRIG_ALGO_RANDOMX
Rx::init(job,
Rx::init(d_ptr->job,
d_ptr->controller->config()->rx().threads(),
d_ptr->controller->config()->cpu().isHugePages(),
d_ptr->controller->config()->rx().isNUMA()

View file

@ -36,7 +36,10 @@ static const char *kAffinity = "affinity";
static const char *kAsterisk = "*";
static const char *kCpu = "cpu";
static const char *kIntensity = "intensity";
static const char *kRandomX = "randomx";
#ifdef XMRIG_ALGO_RANDOMX
static const char *kRandomX = "randomx";
#endif
static inline uint64_t intensity(uint64_t av)