aboutsummaryrefslogtreecommitdiff
path: root/src/node/blockstorage.h
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2021-04-18 09:46:01 +0200
committerMarcoFalke <falke.marco@gmail.com>2021-04-27 10:32:24 +0200
commitfa81c30c6f1adac79517c958090db174eb6aeda2 (patch)
treea83760d0de2e77e6e4ad28877bc3a1616b52461e /src/node/blockstorage.h
parent19a56d1519fb493c3e1bd5cad55360b6b80fa52b (diff)
downloadbitcoin-fa81c30c6f1adac79517c958090db174eb6aeda2.tar.xz
refactor: Move pruning/reindex/importing globals to blockstorage
Can be reviewed with --color-moved=dimmed-zebra
Diffstat (limited to 'src/node/blockstorage.h')
-rw-r--r--src/node/blockstorage.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/node/blockstorage.h b/src/node/blockstorage.h
index 3b546f0719..a5c822030d 100644
--- a/src/node/blockstorage.h
+++ b/src/node/blockstorage.h
@@ -25,6 +25,21 @@ struct Params;
static constexpr bool DEFAULT_STOPAFTERBLOCKIMPORT{false};
+extern std::atomic_bool fImporting;
+extern std::atomic_bool fReindex;
+/** Pruning-related variables and constants */
+/** True if any block files have ever been pruned. */
+extern bool fHavePruned;
+/** True if we're running in -prune mode. */
+extern bool fPruneMode;
+/** Number of MiB of block files that we're trying to stay below. */
+extern uint64_t nPruneTarget;
+
+//! Check whether the block associated with this index entry is pruned or not.
+bool IsBlockPruned(const CBlockIndex* pblockindex);
+
+void CleanupBlockRevFiles();
+
/** Functions for disk access for blocks */
bool ReadBlockFromDisk(CBlock& block, const FlatFilePos& pos, const Consensus::Params& consensusParams);
bool ReadBlockFromDisk(CBlock& block, const CBlockIndex* pindex, const Consensus::Params& consensusParams);