Add BlockManager::GetPruneTarget()

This commit is contained in:
MarcoFalke
2023-01-16 17:08:35 +01:00
parent fa0f0436d8
commit fae71fe27e
4 changed files with 11 additions and 7 deletions

View File

@@ -1617,8 +1617,10 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
// On first startup, warn on low block storage space
if (!fReindex && !fReindexChainState && chain_active_height <= 1) {
uint64_t additional_bytes_needed = fPruneMode ? nPruneTarget
: chainparams.AssumedBlockchainSize() * 1024 * 1024 * 1024;
uint64_t additional_bytes_needed{
fPruneMode ?
chainman.m_blockman.GetPruneTarget() :
chainparams.AssumedBlockchainSize() * 1024 * 1024 * 1024};
if (!CheckDiskSpace(args.GetBlocksDirPath(), additional_bytes_needed)) {
InitWarning(strprintf(_(