even more debug

This commit is contained in:
Duke Leto
2022-06-30 09:18:58 -04:00
parent b99772e622
commit 2353f1a433

View File

@@ -1036,7 +1036,7 @@ void static RandomXMiner()
miningTimer.start();
try {
fprintf(stderr,"trying %s Mining with randomx\n",SMART_CHAIN_SYMBOL);
fprintf(stderr,"RandomXMiner: mining %s with randomx\n",SMART_CHAIN_SYMBOL);
while (true)
{
@@ -1241,15 +1241,18 @@ void static RandomXMiner()
solutionTargetChecks.increment();
B = *pblock;
h = UintToArith256(B.GetHash());
fprintf(stderr,"RandomXMiner: h=");
for (z=31; z>=0; z--)
fprintf(stderr,"%02x",((uint8_t *)&h)[z]);
fprintf(stderr," , hashTarget=");
for (z=31; z>=0; z--)
fprintf(stderr,"%02x",((uint8_t *)&hashTarget)[z]);
fprintf(stderr,"\n");
if ( h > hashTarget )
{
fprintf(stderr,"RandomXMiner: h > hashTarget h=");
for (z=31; z>=0; z--)
fprintf(stderr,"%02x",((uint8_t *)&h)[z]);
fprintf(stderr," , hashTarget=");
for (z=31; z>=0; z--)
fprintf(stderr,"%02x",((uint8_t *)&hashTarget)[z]);
fprintf(stderr,"\n");
fprintf(stderr,"RandomXMiner: h > hashTarget");
return false;
}
@@ -1295,7 +1298,7 @@ void static RandomXMiner()
std::vector<unsigned char> sol_char(randomxHash, randomxHash+32); // = GetMinimalFromIndices(index_vector, DIGITBITS);
bool found = validBlock(sol_char);
if (found) {
LogPrintf("HushRandomXMiner found solution!\n");
fprintf(stderr,"RandomXMiner: found solution!\n");
// If we find a POW solution, do not try other solutions
// because they become invalid as we created a new block in blockchain.
break;