1
0
mirror of https://github.com/xmrig/xmrig.git synced 2025-12-07 16:05:05 -05:00

Merge pull request #3198 from SChernykh/dev

Fixed broken RandomX light mode mining
This commit is contained in:
xmrig
2023-01-21 22:05:25 +07:00
committed by GitHub
2 changed files with 7 additions and 0 deletions

View File

@@ -33,6 +33,7 @@
#include "crypto/common/Nonce.h" #include "crypto/common/Nonce.h"
#include "crypto/common/VirtualMemory.h" #include "crypto/common/VirtualMemory.h"
#include "crypto/rx/Rx.h" #include "crypto/rx/Rx.h"
#include "crypto/rx/RxCache.h"
#include "crypto/rx/RxDataset.h" #include "crypto/rx/RxDataset.h"
#include "crypto/rx/RxVm.h" #include "crypto/rx/RxVm.h"
#include "crypto/ghostrider/ghostrider.h" #include "crypto/ghostrider/ghostrider.h"
@@ -145,6 +146,11 @@ void xmrig::CpuWorker<N>::allocateRandomX_VM()
uint8_t* scratchpad = m_memory->isHugePages() ? m_memory->scratchpad() : dataset->tryAllocateScrathpad(); uint8_t* scratchpad = m_memory->isHugePages() ? m_memory->scratchpad() : dataset->tryAllocateScrathpad();
m_vm = RxVm::create(dataset, scratchpad ? scratchpad : m_memory->scratchpad(), !m_hwAES, m_assembly, node()); m_vm = RxVm::create(dataset, scratchpad ? scratchpad : m_memory->scratchpad(), !m_hwAES, m_assembly, node());
} }
else if (!dataset->get() && (m_job.currentJob().seed() != m_seed)) {
// Update RandomX light VM with the new seed
randomx_vm_set_cache(m_vm, dataset->cache()->get());
}
m_seed = m_job.currentJob().seed();
} }
#endif #endif

View File

@@ -97,6 +97,7 @@ private:
# ifdef XMRIG_ALGO_RANDOMX # ifdef XMRIG_ALGO_RANDOMX
randomx_vm *m_vm = nullptr; randomx_vm *m_vm = nullptr;
Buffer m_seed;
# endif # endif
# ifdef XMRIG_ALGO_GHOSTRIDER # ifdef XMRIG_ALGO_GHOSTRIDER