From 18910ca14d77d682f30d364056423e582102b5ee Mon Sep 17 00:00:00 2001 From: Duke Leto Date: Sun, 6 Dec 2020 20:24:02 -0500 Subject: [PATCH] Only log when zouts exist and less noise to STDOUT by default --- src/main.cpp | 16 +++++++++------- src/wallet/wallet.cpp | 4 +++- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 4dd1065fe..5526b2f57 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -4786,15 +4786,17 @@ bool ReceivedBlockTransactions(const CBlock &block, CValidationState& state, CBl fprintf(stderr,"%s: tx=%s has zspends=%d zouts=%d\n", __FUNCTION__, tx.GetHash().ToString().c_str(), nShieldedSpends, nShieldedOutputs ); } } - fprintf(stderr,"%s: block %s has total zspends=%d zouts=%d\n", __FUNCTION__, block.GetHash().ToString().c_str(), nShieldedSpendsInBlock, nShieldedOutputsInBlock ); + if (fDebug) { + fprintf(stderr,"%s: block %s has total zspends=%d zouts=%d\n", __FUNCTION__, block.GetHash().ToString().c_str(), nShieldedSpendsInBlock, nShieldedOutputsInBlock ); + } - pindexNew->nSproutValue = sproutValue; - pindexNew->nChainSproutValue = boost::none; - pindexNew->nSaplingValue = saplingValue; + pindexNew->nSproutValue = sproutValue; + pindexNew->nChainSproutValue = boost::none; + pindexNew->nSaplingValue = saplingValue; pindexNew->nChainSaplingValue = boost::none; - pindexNew->nFile = pos.nFile; - pindexNew->nDataPos = pos.nPos; - pindexNew->nUndoPos = 0; + pindexNew->nFile = pos.nFile; + pindexNew->nDataPos = pos.nPos; + pindexNew->nUndoPos = 0; pindexNew->nStatus |= BLOCK_HAVE_DATA; pindexNew->RaiseValidity(BLOCK_VALID_TRANSACTIONS); diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index ec316beff..2561dbdbb 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -1687,7 +1687,9 @@ std::pair CWallet::FindMySap LOCK(cs_SpendingKeyStore); uint256 hash = tx.GetHash(); uint32_t nZouts = tx.vShieldedOutput.size(); - LogPrintf("%s: zouts=%d in tx=%s\n",__func__,nZouts, hash.ToString().c_str()); + if(fDebug && (nZouts > 0)) { + LogPrintf("%s: zouts=%d in tx=%s\n",__func__,nZouts, hash.ToString().c_str()); + } mapSaplingNoteData_t noteData; SaplingIncomingViewingKeyMap viewingKeysToAdd;