Skip to content

Commit fa7e64d

Browse files
author
MarcoFalke
committed
move-only: Move constants to blockstorage
1 parent fa247a3 commit fa7e64d

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

src/node/blockstorage.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@ struct Params;
2525

2626
static constexpr bool DEFAULT_STOPAFTERBLOCKIMPORT{false};
2727

28+
/** The pre-allocation chunk size for blk?????.dat files (since 0.8) */
29+
static const unsigned int BLOCKFILE_CHUNK_SIZE = 0x1000000; // 16 MiB
30+
/** The pre-allocation chunk size for rev?????.dat files (since 0.8) */
31+
static const unsigned int UNDOFILE_CHUNK_SIZE = 0x100000; // 1 MiB
32+
/** The maximum size of a blk?????.dat file (since 0.8) */
33+
static const unsigned int MAX_BLOCKFILE_SIZE = 0x8000000; // 128 MiB
34+
2835
extern std::atomic_bool fImporting;
2936
extern std::atomic_bool fReindex;
3037
/** Pruning-related variables and constants */

src/validation.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,6 @@
6666
static const unsigned int EXTRA_DESCENDANT_TX_SIZE_LIMIT = 10000;
6767
/** Maximum kilobytes for transactions to store for processing during reorg */
6868
static const unsigned int MAX_DISCONNECTED_TX_POOL_SIZE = 20000;
69-
/** The pre-allocation chunk size for blk?????.dat files (since 0.8) */
70-
static const unsigned int BLOCKFILE_CHUNK_SIZE = 0x1000000; // 16 MiB
71-
/** The pre-allocation chunk size for rev?????.dat files (since 0.8) */
72-
static const unsigned int UNDOFILE_CHUNK_SIZE = 0x100000; // 1 MiB
7369
/** Time to wait between writing blocks/block index to disk. */
7470
static constexpr std::chrono::hours DATABASE_WRITE_INTERVAL{1};
7571
/** Time to wait between flushing chainstate to disk. */

src/validation.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,6 @@ static const unsigned int DEFAULT_DESCENDANT_LIMIT = 25;
7171
static const unsigned int DEFAULT_DESCENDANT_SIZE_LIMIT = 101;
7272
/** Default for -mempoolexpiry, expiration time for mempool transactions in hours */
7373
static const unsigned int DEFAULT_MEMPOOL_EXPIRY = 336;
74-
/** The maximum size of a blk?????.dat file (since 0.8) */
75-
static const unsigned int MAX_BLOCKFILE_SIZE = 0x8000000; // 128 MiB
7674
/** Maximum number of dedicated script-checking threads allowed */
7775
static const int MAX_SCRIPTCHECK_THREADS = 15;
7876
/** -par default (number of script-checking threads, 0 = auto) */

src/wallet/test/wallet_tests.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <vector>
1212

1313
#include <interfaces/chain.h>
14+
#include <node/blockstorage.h>
1415
#include <node/context.h>
1516
#include <policy/policy.h>
1617
#include <rpc/server.h>

0 commit comments

Comments
 (0)