diff --git a/src/validation.h b/src/validation.h --- a/src/validation.h +++ b/src/validation.h @@ -75,14 +75,11 @@ static const unsigned int DEFAULT_MEMPOOL_EXPIRY = 336; /** The maximum size of a blk?????.dat file (since 0.8) */ static const unsigned int MAX_BLOCKFILE_SIZE = 0x8000000; // 128 MiB - /** Maximum number of dedicated script-checking threads allowed */ static const int MAX_SCRIPTCHECK_THREADS = 15; /** -par default (number of script-checking threads, 0 = auto) */ static const int DEFAULT_SCRIPTCHECK_THREADS = 0; - static const int64_t DEFAULT_MAX_TIP_AGE = 24 * 60 * 60; - static const bool DEFAULT_CHECKPOINTS_ENABLED = true; static const bool DEFAULT_TXINDEX = false; static const char *const DEFAULT_BLOCKFILTERINDEX = "0"; @@ -105,6 +102,27 @@ * This value should be >> block propagation and validation time */ static const int64_t DEFAULT_MIN_FINALIZATION_DELAY = 2 * 60 * 60; +/** + * Block files containing a block-height within MIN_BLOCKS_TO_KEEP of + * ::ChainActive().Tip() will not be pruned. + */ +static const unsigned int MIN_BLOCKS_TO_KEEP = 288; +static const signed int DEFAULT_CHECKBLOCKS = 6; +static const unsigned int DEFAULT_CHECKLEVEL = 3; +/** + * Require that user allocate at least 550 MiB for block & undo files + * (blk???.dat and rev???.dat) + * At 1MB per block, 288 blocks = 288MB. + * Add 15% for Undo data = 331MB + * Add 20% for Orphan block rate = 397MB + * We want the low water mark after pruning to be at least 397 MB and since we + * prune in full block file chunks, we need the high water mark which triggers + * the prune to be one 128MB block file + added 15% undo data = 147MB greater + * for a total of 545MB + * Setting the target to >= 550 MiB will make it likely we can respect the + * target. + */ +static const uint64_t MIN_DISK_SPACE_FOR_BLOCK_FILES = 550 * 1024 * 1024; /** Current sync state passed to tip changed callbacks. */ enum class SynchronizationState { INIT_REINDEX, INIT_DOWNLOAD, POST_INIT }; @@ -156,29 +174,6 @@ extern bool fPruneMode; /** Number of MiB of block files that we're trying to stay below. */ extern uint64_t nPruneTarget; -/** - * Block files containing a block-height within MIN_BLOCKS_TO_KEEP of - * ::ChainActive().Tip() will not be pruned. - */ -static const unsigned int MIN_BLOCKS_TO_KEEP = 288; - -static const signed int DEFAULT_CHECKBLOCKS = 6; -static const unsigned int DEFAULT_CHECKLEVEL = 3; - -/** - * Require that user allocate at least 550 MiB for block & undo files - * (blk???.dat and rev???.dat) - * At 1MB per block, 288 blocks = 288MB. - * Add 15% for Undo data = 331MB - * Add 20% for Orphan block rate = 397MB - * We want the low water mark after pruning to be at least 397 MB and since we - * prune in full block file chunks, we need the high water mark which triggers - * the prune to be one 128MB block file + added 15% undo data = 147MB greater - * for a total of 545MB - * Setting the target to >= 550 MiB will make it likely we can respect the - * target. - */ -static const uint64_t MIN_DISK_SPACE_FOR_BLOCK_FILES = 550 * 1024 * 1024; class BlockValidationOptions { private: