From 2353f1a4337a3049d5ccdc3fffaeb53b2461d8b2 Mon Sep 17 00:00:00 2001 From: Duke Leto Date: Thu, 30 Jun 2022 09:18:58 -0400 Subject: [PATCH] even more debug --- src/miner.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/miner.cpp b/src/miner.cpp index 9b5e1648d..ea987e9b1 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -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 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;