Error checking for randomx vm creation

This commit is contained in:
Duke Leto
2022-02-21 09:41:08 -05:00
parent 8eab796800
commit c5743d5985

View File

@@ -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);