aboutsummaryrefslogtreecommitdiff
path: root/src/crypto/rx-slow-hash.c
diff options
context:
space:
mode:
authorcohcho <chat.freenode.net/cohcho>2020-01-17 19:25:26 +0000
committercohcho <chat.freenode.net/cohcho>2020-01-17 19:25:26 +0000
commitfe92fa1391c200fce4a247341272011099781369 (patch)
tree4ad40471330f6c50a4ed1ed2ddf1360be0e8708d /src/crypto/rx-slow-hash.c
parentMerge pull request #6145 (diff)
downloadmonero-fe92fa1391c200fce4a247341272011099781369.tar.xz
[randomx] Add missing randomx_vm_set_cache()
Diffstat (limited to 'src/crypto/rx-slow-hash.c')
-rw-r--r--src/crypto/rx-slow-hash.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/crypto/rx-slow-hash.c b/src/crypto/rx-slow-hash.c
index a7a459ad3..0f38356fa 100644
--- a/src/crypto/rx-slow-hash.c
+++ b/src/crypto/rx-slow-hash.c
@@ -278,6 +278,10 @@ void rx_slow_hash(const uint64_t mainheight, const uint64_t seedheight, const ch
CTHR_MUTEX_LOCK(rx_dataset_mutex);
if (rx_dataset != NULL && rx_dataset_height != seedheight)
rx_initdata(cache, miners, seedheight);
+ else if (rx_dataset == NULL) {
+ /* this is a no-op if the cache hasn't changed */
+ randomx_vm_set_cache(rx_vm, rx_sp->rs_cache);
+ }
CTHR_MUTEX_UNLOCK(rx_dataset_mutex);
} else {
/* this is a no-op if the cache hasn't changed */