Start using -zdebug so we don't scare normal users with all this output

This commit is contained in:
Duke Leto
2019-12-31 08:19:01 -05:00
parent bec886ec43
commit c4320775f7
2 changed files with 8 additions and 5 deletions

View File

@@ -334,12 +334,13 @@ void CCoinsViewCache::PopAnchor(const uint256 &newrt, ShieldedType type) {
} }
void CCoinsViewCache::SetNullifiers(const CTransaction& tx, bool spent) { void CCoinsViewCache::SetNullifiers(const CTransaction& tx, bool spent) {
LogPrintf("%s: spent=%d\n", __FUNCTION__, spent);
for (const SpendDescription &spendDescription : tx.vShieldedSpend) { for (const SpendDescription &spendDescription : tx.vShieldedSpend) {
std::pair<CNullifiersMap::iterator, bool> ret = cacheSaplingNullifiers.insert(std::make_pair(spendDescription.nullifier, CNullifiersCacheEntry())); std::pair<CNullifiersMap::iterator, bool> ret = cacheSaplingNullifiers.insert(std::make_pair(spendDescription.nullifier, CNullifiersCacheEntry()));
ret.first->second.entered = spent; ret.first->second.entered = spent;
ret.first->second.flags |= CNullifiersCacheEntry::DIRTY; 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());
} }
} }

View File

@@ -1,6 +1,6 @@
// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2014 The Bitcoin Core developers // 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 // Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php. // 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<std::pair<int, const CBlockFileInfo*> >& fileInfo, int nLastFile, const std::vector<const CBlockIndex*>& blockinfo) { bool CBlockTreeDB::WriteBatchSync(const std::vector<std::pair<int, const CBlockFileInfo*> >& fileInfo, int nLastFile, const std::vector<const CBlockIndex*>& blockinfo) {
CDBBatch batch(*this); CDBBatch batch(*this);
fprintf(stderr, "%s: Writing block files\n", __FUNCTION__); if (fZdebug)
fprintf(stderr, "%s: Writing block files\n", __FUNCTION__);
for (std::vector<std::pair<int, const CBlockFileInfo*> >::const_iterator it=fileInfo.begin(); it != fileInfo.end(); it++) { for (std::vector<std::pair<int, const CBlockFileInfo*> >::const_iterator it=fileInfo.begin(); it != fileInfo.end(); it++) {
batch.Write(make_pair(DB_BLOCK_FILES, it->first), *it->second); batch.Write(make_pair(DB_BLOCK_FILES, it->first), *it->second);
} }
batch.Write(DB_LAST_BLOCK, nLastFile); 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 CBlockIndex*>::const_iterator it=blockinfo.begin(); it != blockinfo.end(); it++) { for (std::vector<const CBlockIndex*>::const_iterator it=blockinfo.begin(); it != blockinfo.end(); it++) {
batch.Write(make_pair(DB_BLOCK_INDEX, (*it)->GetBlockHash()), CDiskBlockIndex(*it)); batch.Write(make_pair(DB_BLOCK_INDEX, (*it)->GetBlockHash()), CDiskBlockIndex(*it));
} }