Fix RandomX init when switching to other algo and back

This commit is contained in:
SChernykh 2020-11-29 22:02:48 +01:00
parent 13ee9d09a8
commit d557fe7f39

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;