From f0a2fb3c5dbf3c4bec7faf934baff3e723734b3f Mon Sep 17 00:00:00 2001 From: Carl Dong Date: Fri, 18 Mar 2022 12:35:52 -0400 Subject: scripted-diff: Rename pindexBestHeader, fHavePruned ...to m_best_header and m_have_pruned -BEGIN VERIFY SCRIPT- find_regex="\bpindexBestHeader\b" \ && git grep -l -E "$find_regex" -- src \ | xargs sed -i -E "s@$find_regex@m_best_header@g" find_regex="\bfHavePruned\b" \ && git grep -l -E "$find_regex" -- src \ | xargs sed -i -E "s@$find_regex@m_have_pruned@g" -END VERIFY SCRIPT- --- src/node/blockstorage.cpp | 8 ++++---- src/node/blockstorage.h | 2 +- src/node/chainstate.cpp | 4 ++-- src/node/interfaces.cpp | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src/node') diff --git a/src/node/blockstorage.cpp b/src/node/blockstorage.cpp index f3a1afd9fa..21cb0250d8 100644 --- a/src/node/blockstorage.cpp +++ b/src/node/blockstorage.cpp @@ -301,7 +301,7 @@ void BlockManager::Unload() m_dirty_blockindex.clear(); m_dirty_fileinfo.clear(); - fHavePruned = false; + m_have_pruned = false; } bool BlockManager::WriteBlockIndexDB() @@ -364,8 +364,8 @@ bool BlockManager::LoadBlockIndexDB() } // Check whether we have ever pruned block & undo files - m_block_tree_db->ReadFlag("prunedblockfiles", fHavePruned); - if (fHavePruned) { + m_block_tree_db->ReadFlag("prunedblockfiles", m_have_pruned); + if (m_have_pruned) { LogPrintf("LoadBlockIndexDB(): Block files have previously been pruned\n"); } @@ -394,7 +394,7 @@ const CBlockIndex* BlockManager::GetLastCheckpoint(const CCheckpointData& data) bool BlockManager::IsBlockPruned(const CBlockIndex* pblockindex) { AssertLockHeld(::cs_main); - return (fHavePruned && !(pblockindex->nStatus & BLOCK_HAVE_DATA) && pblockindex->nTx > 0); + return (m_have_pruned && !(pblockindex->nStatus & BLOCK_HAVE_DATA) && pblockindex->nTx > 0); } // If we're using -prune with -reindex, then delete block files that will be ignored by the diff --git a/src/node/blockstorage.h b/src/node/blockstorage.h index 332dc2e28a..11445aa22e 100644 --- a/src/node/blockstorage.h +++ b/src/node/blockstorage.h @@ -170,7 +170,7 @@ public: const CBlockIndex* GetLastCheckpoint(const CCheckpointData& data) EXCLUSIVE_LOCKS_REQUIRED(cs_main); /** True if any block files have ever been pruned. */ - bool fHavePruned = false; + bool m_have_pruned = false; //! Check whether the block associated with this index entry is pruned or not. bool IsBlockPruned(const CBlockIndex* pblockindex) EXCLUSIVE_LOCKS_REQUIRED(::cs_main); diff --git a/src/node/chainstate.cpp b/src/node/chainstate.cpp index 04f36fb78e..e43211402c 100644 --- a/src/node/chainstate.cpp +++ b/src/node/chainstate.cpp @@ -49,7 +49,7 @@ std::optional LoadChainstate(bool fReset, if (shutdown_requested && shutdown_requested()) return ChainstateLoadingError::SHUTDOWN_PROBED; - // LoadBlockIndex will load fHavePruned if we've ever removed a + // LoadBlockIndex will load m_have_pruned if we've ever removed a // block file from disk. // Note that it also sets fReindex based on the disk flag! // From here on out fReindex and fReset mean something different! @@ -65,7 +65,7 @@ std::optional LoadChainstate(bool fReset, // Check for changed -prune state. What we are concerned about is a user who has pruned blocks // in the past, but is now trying to run unpruned. - if (chainman.m_blockman.fHavePruned && !fPruneMode) { + if (chainman.m_blockman.m_have_pruned && !fPruneMode) { return ChainstateLoadingError::ERROR_PRUNED_NEEDS_REINDEX; } diff --git a/src/node/interfaces.cpp b/src/node/interfaces.cpp index d444de022b..954bd1c31d 100644 --- a/src/node/interfaces.cpp +++ b/src/node/interfaces.cpp @@ -212,7 +212,7 @@ public: bool getHeaderTip(int& height, int64_t& block_time) override { LOCK(::cs_main); - auto best_header = chainman().pindexBestHeader; + auto best_header = chainman().m_best_header; if (best_header) { height = best_header->nHeight; block_time = best_header->GetBlockTime(); @@ -645,7 +645,7 @@ public: bool havePruned() override { LOCK(cs_main); - return m_node.chainman->m_blockman.fHavePruned; + return m_node.chainman->m_blockman.m_have_pruned; } bool isReadyToBroadcast() override { return !node::fImporting && !node::fReindex && !isInitialBlockDownload(); } bool isInitialBlockDownload() override { -- cgit v1.2.3