From c5743d59854397d2acc2c8a8a8e7e89830c42eed Mon Sep 17 00:00:00 2001 From: Duke Leto Date: Mon, 21 Feb 2022 09:41:08 -0500 Subject: [PATCH] Error checking for randomx vm creation --- src/miner.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/miner.cpp b/src/miner.cpp index 8b5941dd9..e25d53c34 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -1175,6 +1175,10 @@ void static RandomXMiner() // TODO: use correct variables randomx_init_cache(randomxCache, &randomxKey, sizeof randomxKey); randomx_vm *myVM = randomx_create_vm(flags, randomxCache, NULL); + if(myVM == NULL) { + LogPrintf("Cannot create RandomX VM, aborting!\n"); + return; + } randomx_calculate_hash(myVM, &randomxInput, sizeof randomxInput, randomxHash);