This commit is contained in:
Duke Leto
2022-07-04 01:45:05 -04:00
parent 7dfa3f9475
commit 8ca330dc68

View File

@@ -1312,10 +1312,10 @@ void static RandomXMiner()
std::lock_guard<std::mutex> lock{m_cs};
return cancelSolver;
};
// TODO: solver specific stuff
try {
// TODO: Convert solution to byte array (decompress) and pass it to validBlock method.
std::vector<unsigned char> sol_char(randomxHash, randomxHash+32); // = GetMinimalFromIndices(index_vector, DIGITBITS);
// Use the randomX hash as the block solution
std::vector<unsigned char> sol_char(randomxHash, randomxHash+32);
bool found = validBlock(sol_char);
if (found) {
fprintf(stderr,"RandomXMiner: found solution!\n");
@@ -1327,8 +1327,8 @@ void static RandomXMiner()
}
} catch (RandomXSolverCanceledException&) {
LogPrintf("HushRandomXMiner solver canceled\n");
std::lock_guard<std::mutex> lock{m_cs};
cancelSolver = false;
std::lock_guard<std::mutex> lock{m_cs};
cancelSolver = false;
}
boost::this_thread::interruption_point();
@@ -1337,13 +1337,13 @@ void static RandomXMiner()
{
if ( Mining_height > ASSETCHAINS_MINHEIGHT )
{
fprintf(stderr,"no nodes, break\n");
fprintf(stderr,"%s: no nodes, break\n", __func__);
break;
}
}
if ((UintToArith256(pblock->nNonce) & 0xffff) == 0xffff)
{
fprintf(stderr,"nonce & 0xffff == 0xffff, break\n");
fprintf(stderr,"%s: nonce & 0xffff == 0xffff, break\n", __func__);
break;
}
// Update nNonce and nTime