diff options
author | MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> | 2023-01-16 17:08:35 +0100 |
---|---|---|
committer | MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> | 2023-01-16 17:16:30 +0100 |
commit | fae71fe27ec021583aaeac09aa924522bb63db05 (patch) | |
tree | 606af42a45f23973573b9dc77852b71119c7de94 /src/node/blockstorage.h | |
parent | fa0f0436d83288262d7d764b1d239c1a6de6146f (diff) | |
download | bitcoin-fae71fe27ec021583aaeac09aa924522bb63db05.tar.xz |
Add BlockManager::GetPruneTarget()
Diffstat (limited to 'src/node/blockstorage.h')
-rw-r--r-- | src/node/blockstorage.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/node/blockstorage.h b/src/node/blockstorage.h index 5e82746b6b..eef31bff56 100644 --- a/src/node/blockstorage.h +++ b/src/node/blockstorage.h @@ -51,7 +51,6 @@ extern std::atomic_bool fReindex; /** Pruning-related variables and constants */ /** True if we're running in -prune mode. */ extern bool fPruneMode; -/** Number of bytes of block files that we're trying to stay below. */ extern uint64_t nPruneTarget; // Because validation code takes pointers to the map's CBlockIndex objects, if @@ -176,6 +175,9 @@ public: /** Store block on disk. If dbp is not nullptr, then it provides the known position of the block within a block file on disk. */ FlatFilePos SaveBlockToDisk(const CBlock& block, int nHeight, CChain& active_chain, const CChainParams& chainparams, const FlatFilePos* dbp); + /** Attempt to stay below this number of bytes of block files. */ + [[nodiscard]] uint64_t GetPruneTarget() const { return nPruneTarget; } + [[nodiscard]] bool LoadingBlocks() const { return fImporting || fReindex; |