From 636179ac53f19f8007eafe949673e982d4d762e2 Mon Sep 17 00:00:00 2001 From: moneroexamples Date: Tue, 28 May 2019 07:57:48 +0800 Subject: [PATCH] add mutex to get_randomx_code --- src/page.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/page.h b/src/page.h index 89b7c0f..614c2d7 100644 --- a/src/page.h +++ b/src/page.h @@ -7134,10 +7134,14 @@ get_randomx_code(uint64_t blk_height, block const& blk, crypto::hash const& blk_hash) { + static std::mutex mtx; + vector> rx_code; blobdata bd = get_block_hashing_blob(blk); + std::lock_guard lk {mtx}; + if (!rx_vm) { // this will create rx_vm instance if one