Skip to content

Commit fa4c59d

Browse files
author
MacroFake
committed
Move blockstorage option logging to LoadChainstate()
1 parent fa3358b commit fa4c59d

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/init.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -938,14 +938,12 @@ bool AppInitParameterInteraction(const ArgsManager& args, bool use_syscall_sandb
938938
}
939939
nPruneTarget = (uint64_t) nPruneArg * 1024 * 1024;
940940
if (nPruneArg == 1) { // manual pruning: -prune=1
941-
LogPrintf("Block pruning enabled. Use RPC call pruneblockchain(height) to manually prune block and undo files.\n");
942941
nPruneTarget = std::numeric_limits<uint64_t>::max();
943942
fPruneMode = true;
944943
} else if (nPruneTarget) {
945944
if (nPruneTarget < MIN_DISK_SPACE_FOR_BLOCK_FILES) {
946945
return InitError(strprintf(_("Prune configured below the minimum of %d MiB. Please use a higher number."), MIN_DISK_SPACE_FOR_BLOCK_FILES / 1024 / 1024));
947946
}
948-
LogPrintf("Prune configured to target %u MiB on disk for block and undo files.\n", nPruneTarget / 1024 / 1024);
949947
fPruneMode = true;
950948
}
951949

src/node/chainstate.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ ChainstateLoadResult LoadChainstate(ChainstateManager& chainman, const CacheSize
4141
if (nMinimumChainWork < UintToArith256(chainman.GetConsensus().nMinimumChainWork)) {
4242
LogPrintf("Warning: nMinimumChainWork set below default value of %s\n", chainman.GetConsensus().nMinimumChainWork.GetHex());
4343
}
44+
if (nPruneTarget == std::numeric_limits<uint64_t>::max()) {
45+
LogPrintf("Block pruning enabled. Use RPC call pruneblockchain(height) to manually prune block and undo files.\n");
46+
} else if (nPruneTarget) {
47+
LogPrintf("Prune configured to target %u MiB on disk for block and undo files.\n", nPruneTarget / 1024 / 1024);
48+
}
4449

4550
LOCK(cs_main);
4651
chainman.InitializeChainstate(options.mempool);

0 commit comments

Comments
 (0)