diff options
author | MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> | 2023-01-16 17:23:18 +0100 |
---|---|---|
committer | MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> | 2023-01-16 17:31:32 +0100 |
commit | faf7b4f1fc35f1488567e0e4a57ecb348596b992 (patch) | |
tree | 9392926559a340b437ef3ecf342b56a59c28b321 /src/node/blockstorage.h | |
parent | fae71fe27ec021583aaeac09aa924522bb63db05 (diff) | |
download | bitcoin-faf7b4f1fc35f1488567e0e4a57ecb348596b992.tar.xz |
Add BlockManager::IsPruneMode()
Diffstat (limited to 'src/node/blockstorage.h')
-rw-r--r-- | src/node/blockstorage.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/node/blockstorage.h b/src/node/blockstorage.h index eef31bff56..b6007897df 100644 --- a/src/node/blockstorage.h +++ b/src/node/blockstorage.h @@ -48,8 +48,6 @@ static constexpr size_t BLOCK_SERIALIZATION_HEADER_SIZE = CMessageHeader::MESSAG extern std::atomic_bool fImporting; extern std::atomic_bool fReindex; -/** Pruning-related variables and constants */ -/** True if we're running in -prune mode. */ extern bool fPruneMode; extern uint64_t nPruneTarget; @@ -175,6 +173,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); + /** Whether running in -prune mode. */ + [[nodiscard]] bool IsPruneMode() const { return fPruneMode; } + /** Attempt to stay below this number of bytes of block files. */ [[nodiscard]] uint64_t GetPruneTarget() const { return nPruneTarget; } |