diff --git a/src/coins.cpp b/src/coins.cpp index 7adf5f0fd..ae48c4f90 100644 --- a/src/coins.cpp +++ b/src/coins.cpp @@ -334,12 +334,13 @@ void CCoinsViewCache::PopAnchor(const uint256 &newrt, ShieldedType type) { } void CCoinsViewCache::SetNullifiers(const CTransaction& tx, bool spent) { - LogPrintf("%s: spent=%d\n", __FUNCTION__, spent); + for (const SpendDescription &spendDescription : tx.vShieldedSpend) { std::pair ret = cacheSaplingNullifiers.insert(std::make_pair(spendDescription.nullifier, CNullifiersCacheEntry())); ret.first->second.entered = spent; ret.first->second.flags |= CNullifiersCacheEntry::DIRTY; - LogPrintf("%s: Inserted nullifier=%s into Sapling nullifier cache\n", __FUNCTION__, spendDescription.nullifier.GetHex().c_str()); + if (fZdebug) + LogPrintf("%s: Inserted spent=%d nullifier=%s into Sapling nullifier cache\n", __FUNCTION__, spent, spendDescription.nullifier.GetHex().c_str()); } } diff --git a/src/txdb.cpp b/src/txdb.cpp index 889c3f14a..2a0d5c466 100644 --- a/src/txdb.cpp +++ b/src/txdb.cpp @@ -1,6 +1,6 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin Core developers -// Copyright (c) 2019 The Hush developers +// Copyright (c) 2019-2020 The Hush developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -287,12 +287,14 @@ bool CCoinsViewDB::GetStats(CCoinsStats &stats) const { bool CBlockTreeDB::WriteBatchSync(const std::vector >& fileInfo, int nLastFile, const std::vector& blockinfo) { CDBBatch batch(*this); - fprintf(stderr, "%s: Writing block files\n", __FUNCTION__); + if (fZdebug) + fprintf(stderr, "%s: Writing block files\n", __FUNCTION__); for (std::vector >::const_iterator it=fileInfo.begin(); it != fileInfo.end(); it++) { batch.Write(make_pair(DB_BLOCK_FILES, it->first), *it->second); } batch.Write(DB_LAST_BLOCK, nLastFile); - fprintf(stderr, "%s: Writing block index\n", __FUNCTION__); + if (fZdebug) + fprintf(stderr, "%s: Writing block index\n", __FUNCTION__); for (std::vector::const_iterator it=blockinfo.begin(); it != blockinfo.end(); it++) { batch.Write(make_pair(DB_BLOCK_INDEX, (*it)->GetBlockHash()), CDiskBlockIndex(*it)); }