Merge pull request #1960 from SChernykh/dev

Fix RandomX init when switching to other algo and back
This commit is contained in:
xmrig 2020-11-30 09:20:14 +07:00 committed by GitHub
commit 87195ed237
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -104,10 +104,6 @@ bool xmrig::Rx::init(const T &seed, const RxConfig &config, const CpuConfig &cpu
randomx_set_scratchpad_prefetch_mode(config.scratchpadPrefetchMode());
randomx_set_huge_pages_jit(cpu.isHugePagesJit());
if (isReady(seed)) {
return true;
}
if (!msrInitialized) {
msrEnabled = msrInit(config, cpu.threads().get(seed.algorithm()).data());
msrInitialized = true;
@ -121,6 +117,10 @@ bool xmrig::Rx::init(const T &seed, const RxConfig &config, const CpuConfig &cpu
osInitialized = true;
}
if (isReady(seed)) {
return true;
}
d_ptr->queue.enqueue(seed, config.nodeset(), config.threads(cpu.limit()), cpu.isHugePages(), config.isOneGbPages(), config.mode(), cpu.priority());
return false;