From 6eccab3e983186ef252744c2bf37d7a0dc3756bf Mon Sep 17 00:00:00 2001 From: Duke Leto Date: Tue, 8 Nov 2022 09:07:49 -0500 Subject: [PATCH 1/3] Add missing newline in rxdebug and add debugging about solutionTargetChecks --- src/miner.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/miner.cpp b/src/miner.cpp index 72d6d04df..e8732612a 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -1209,7 +1209,7 @@ void static RandomXMiner() // std::cerr << "RandomXMiner: randomxInput=" << HexStr(randomxInput) << "\n"; // fprintf(stderr,"RandomXMiner: created randomxKey=%s , randomxInput.size=%lu\n", randomxKey, randomxInput.size() ); //randomxInput); - rxdebug("%s: randomxKey=%s randomxInput=%s", randomxKey, HexStr(randomxInput).c_str()); + rxdebug("%s: randomxKey=%s randomxInput=%s\n", randomxKey, HexStr(randomxInput).c_str()); randomx_flags flags = randomx_get_flags(); randomx_cache *randomxCache = randomx_alloc_cache(flags); @@ -1277,6 +1277,7 @@ void static RandomXMiner() rxdebug("%s: Checking solution against target\n"); pblock->nSolution = soln; solutionTargetChecks.increment(); + rxdebug("%s: solutionTargetChecks=%d\n", solutionTargetChecks.get()); B = *pblock; h = UintToArith256(B.GetHash()); From 5aea7523371799d6b57e6d92c80d1f6696076f18 Mon Sep 17 00:00:00 2001 From: Duke Leto Date: Tue, 8 Nov 2022 09:16:27 -0500 Subject: [PATCH 2/3] Fix compiler warnings --- src/miner.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/miner.cpp b/src/miner.cpp index e8732612a..92acea2d9 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -1277,7 +1277,7 @@ void static RandomXMiner() rxdebug("%s: Checking solution against target\n"); pblock->nSolution = soln; solutionTargetChecks.increment(); - rxdebug("%s: solutionTargetChecks=%d\n", solutionTargetChecks.get()); + fprintf(stderr,"%s: solutionTargetChecks=%lu\n", __func__, solutionTargetChecks.get()); B = *pblock; h = UintToArith256(B.GetHash()); @@ -1646,6 +1646,7 @@ void static BitcoinMiner() LogPrint("pow", "- Checking solution against target\n"); pblock->nSolution = soln; solutionTargetChecks.increment(); + rxdebug("%s: solutionTargetChecks=%lu\n", solutionTargetChecks.get()); B = *pblock; h = UintToArith256(B.GetHash()); /*for (z=31; z>=16; z--) From ca52c6beb87ecbe35b7571b5cf4f701f9060bc0f Mon Sep 17 00:00:00 2001 From: "Jonathan \"Duke\" Leto" Date: Fri, 11 Nov 2022 04:26:18 -0800 Subject: [PATCH 3/3] Avoid potential coredump if pindex is NULL --- src/wallet/wallet.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index bc2d75752..001c42718 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -2771,7 +2771,7 @@ int CWallet::ScanForWalletTransactions(CBlockIndex* pindexStart, bool fUpdate) // our wallet birthday (as adjusted for block time variability) while (pindex && nTimeFirstKey && (pindex->GetBlockTime() < (nTimeFirstKey - 7200))) { pindex = chainActive.Next(pindex); - pwalletMain->rescanHeight = pindex->GetHeight(); + pwalletMain->rescanHeight = pindex ? pindex->GetHeight() : 0; } ShowProgress(_("Rescanning..."), 0); // show rescan progress in GUI as dialog or on splashscreen, if -rescan on startup