aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMacroFake <falke.marco@gmail.com>2022-10-04 12:35:56 +0200
committerMacroFake <falke.marco@gmail.com>2022-10-04 12:36:13 +0200
commit914c00074b62b911e16103254279beb5e3255429 (patch)
tree9ca376794d081d5220ef6452eca70144f998a771 /src
parentf65a2c6f574f895fd5e3701cc915a8ed0102e3ec (diff)
parent7d14577d0f9316feef3bcb5220aa3037748615d3 (diff)
Merge bitcoin/bitcoin#26235: refactor: move *index constants out of validation
7d14577d0f9316feef3bcb5220aa3037748615d3 refactor: move DEFAULT_BLOCKFILTERINDEX from val to blockfilterindex (fanquake) c87d569189992c08d932fd3bf2f9aa8ef689a398 refactor: move DEFAULT_COINSTATSINDEX from validation to coinstatsindex (fanquake) 2bfc1e6aaaf8aa392f1f85050686ea6293aa817c refactor: move DEFAULT_TXINDEX from validation to txindex (fanquake) Pull request description: Move `*index` default constants out of `validation.h`. ACKs for top commit: stickies-v: re-ACK 7d14577d0f9316feef3bcb5220aa3037748615d3 aureleoules: ACK 7d14577d0f9316feef3bcb5220aa3037748615d3 Tree-SHA512: 3021db1a63ceb714dee4b91f755d1fb9a6633adb6f1081e34e4179900e7543e3a7b06fe47507d580a3a2caf52f7ede784cb36716d521c76b0404bdc798f0186a
Diffstat (limited to 'src')
-rw-r--r--src/index/blockfilterindex.h2
-rw-r--r--src/index/coinstatsindex.h2
-rw-r--r--src/index/txindex.h2
-rw-r--r--src/node/caches.cpp2
-rw-r--r--src/validation.h3
5 files changed, 7 insertions, 4 deletions
diff --git a/src/index/blockfilterindex.h b/src/index/blockfilterindex.h
index 5af4671091..9e69388dc8 100644
--- a/src/index/blockfilterindex.h
+++ b/src/index/blockfilterindex.h
@@ -12,6 +12,8 @@
#include <index/base.h>
#include <util/hasher.h>
+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/index/coinstatsindex.h b/src/index/coinstatsindex.h
index fa59cb1ab1..aa0d7f9fd5 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/index/txindex.h b/src/index/txindex.h
index 8c1aa00033..4cea35045d 100644
--- a/src/index/txindex.h
+++ b/src/index/txindex.h
@@ -7,6 +7,8 @@
#include <index/base.h>
+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 f168332ee6..a39ad7aeb6 100644
--- a/src/node/caches.cpp
+++ b/src/node/caches.cpp
@@ -4,9 +4,9 @@
#include <node/caches.h>
+#include <index/txindex.h>
#include <txdb.h>
#include <util/system.h>
-#include <validation.h>
namespace node {
CacheSizes CalculateCacheSizes(const ArgsManager& args, size_t n_indexes)
diff --git a/src/validation.h b/src/validation.h
index 9ba206855f..c882eac408 100644
--- a/src/validation.h
+++ b/src/validation.h
@@ -65,9 +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 */
static const int DEFAULT_STOPATHEIGHT = 0;
/** Block files containing a block-height within MIN_BLOCKS_TO_KEEP of ActiveChain().Tip() will not be pruned. */