From 2bfc1e6aaaf8aa392f1f85050686ea6293aa817c Mon Sep 17 00:00:00 2001 From: fanquake Date: Mon, 3 Oct 2022 15:53:22 +0100 Subject: [PATCH 1/3] refactor: move DEFAULT_TXINDEX from validation to txindex --- src/index/txindex.h | 2 ++ src/node/caches.cpp | 2 +- src/validation.h | 1 - 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/index/txindex.h b/src/index/txindex.h index 8c1aa000339..4cea35045df 100644 --- a/src/index/txindex.h +++ b/src/index/txindex.h @@ -7,6 +7,8 @@ #include +static constexpr bool DEFAULT_TXINDEX{false}; + /** * TxIndex is used to look up transactions included in the blockchain by hash. * The index is written to a LevelDB database and records the filesystem diff --git a/src/node/caches.cpp b/src/node/caches.cpp index f168332ee65..a39ad7aeb66 100644 --- a/src/node/caches.cpp +++ b/src/node/caches.cpp @@ -4,9 +4,9 @@ #include +#include #include #include -#include namespace node { CacheSizes CalculateCacheSizes(const ArgsManager& args, size_t n_indexes) diff --git a/src/validation.h b/src/validation.h index 9ba206855f0..7600956db92 100644 --- a/src/validation.h +++ b/src/validation.h @@ -65,7 +65,6 @@ static const int MAX_SCRIPTCHECK_THREADS = 15; 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 constexpr bool DEFAULT_COINSTATSINDEX{false}; static const char* const DEFAULT_BLOCKFILTERINDEX = "0"; /** Default for -stopatheight */ From c87d569189992c08d932fd3bf2f9aa8ef689a398 Mon Sep 17 00:00:00 2001 From: fanquake Date: Mon, 3 Oct 2022 15:54:49 +0100 Subject: [PATCH 2/3] refactor: move DEFAULT_COINSTATSINDEX from validation to coinstatsindex --- src/index/coinstatsindex.h | 2 ++ src/validation.h | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/index/coinstatsindex.h b/src/index/coinstatsindex.h index fa59cb1ab18..aa0d7f9fd5c 100644 --- a/src/index/coinstatsindex.h +++ b/src/index/coinstatsindex.h @@ -14,6 +14,8 @@ namespace kernel { struct CCoinsStats; } +static constexpr bool DEFAULT_COINSTATSINDEX{false}; + /** * CoinStatsIndex maintains statistics on the UTXO set. */ diff --git a/src/validation.h b/src/validation.h index 7600956db92..c42f9a1c755 100644 --- a/src/validation.h +++ b/src/validation.h @@ -65,7 +65,6 @@ static const int MAX_SCRIPTCHECK_THREADS = 15; 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 constexpr bool DEFAULT_COINSTATSINDEX{false}; static const char* const DEFAULT_BLOCKFILTERINDEX = "0"; /** Default for -stopatheight */ static const int DEFAULT_STOPATHEIGHT = 0; From 7d14577d0f9316feef3bcb5220aa3037748615d3 Mon Sep 17 00:00:00 2001 From: fanquake Date: Mon, 3 Oct 2022 15:57:13 +0100 Subject: [PATCH 3/3] refactor: move DEFAULT_BLOCKFILTERINDEX from val to blockfilterindex --- src/index/blockfilterindex.h | 2 ++ src/validation.h | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/index/blockfilterindex.h b/src/index/blockfilterindex.h index 5af46710910..9e69388dc82 100644 --- a/src/index/blockfilterindex.h +++ b/src/index/blockfilterindex.h @@ -12,6 +12,8 @@ #include #include +static const char* const DEFAULT_BLOCKFILTERINDEX = "0"; + /** Interval between compact filter checkpoints. See BIP 157. */ static constexpr int CFCHECKPT_INTERVAL = 1000; diff --git a/src/validation.h b/src/validation.h index c42f9a1c755..c882eac4088 100644 --- a/src/validation.h +++ b/src/validation.h @@ -65,7 +65,6 @@ static const int MAX_SCRIPTCHECK_THREADS = 15; 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 char* const DEFAULT_BLOCKFILTERINDEX = "0"; /** Default for -stopatheight */ static const int DEFAULT_STOPATHEIGHT = 0; /** Block files containing a block-height within MIN_BLOCKS_TO_KEEP of ActiveChain().Tip() will not be pruned. */