Skip to content

Commit 0109622

Browse files
committed
[validation] Move validation-only consts to validation.cpp
1 parent b8580ca commit 0109622

File tree

2 files changed

+19
-18
lines changed

2 files changed

+19
-18
lines changed

src/validation.cpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,25 @@
5959
#define MICRO 0.000001
6060
#define MILLI 0.001
6161

62+
/**
63+
* An extra transaction can be added to a package, as long as it only has one
64+
* ancestor and is no larger than this. Not really any reason to make this
65+
* configurable as it doesn't materially change DoS parameters.
66+
*/
67+
static const unsigned int EXTRA_DESCENDANT_TX_SIZE_LIMIT = 10000;
68+
/** Maximum kilobytes for transactions to store for processing during reorg */
69+
static const unsigned int MAX_DISCONNECTED_TX_POOL_SIZE = 20000;
70+
/** The pre-allocation chunk size for blk?????.dat files (since 0.8) */
71+
static const unsigned int BLOCKFILE_CHUNK_SIZE = 0x1000000; // 16 MiB
72+
/** The pre-allocation chunk size for rev?????.dat files (since 0.8) */
73+
static const unsigned int UNDOFILE_CHUNK_SIZE = 0x100000; // 1 MiB
74+
/** Time to wait (in seconds) between writing blocks/block index to disk. */
75+
static const unsigned int DATABASE_WRITE_INTERVAL = 60 * 60;
76+
/** Time to wait (in seconds) between flushing chainstate to disk. */
77+
static const unsigned int DATABASE_FLUSH_INTERVAL = 24 * 60 * 60;
78+
/** Maximum age of our tip in seconds for us to be considered current for fee estimation */
79+
static const int64_t MAX_FEE_ESTIMATION_TIP_AGE = 3 * 60 * 60;
80+
6281
bool CBlockIndexWorkComparator::operator()(const CBlockIndex *pa, const CBlockIndex *pb) const {
6382
// First sort by most total work, ...
6483
if (pa->nChainWork > pb->nChainWork) return false;

src/validation.h

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -60,35 +60,17 @@ static const unsigned int DEFAULT_ANCESTOR_SIZE_LIMIT = 101;
6060
static const unsigned int DEFAULT_DESCENDANT_LIMIT = 25;
6161
/** Default for -limitdescendantsize, maximum kilobytes of in-mempool descendants */
6262
static const unsigned int DEFAULT_DESCENDANT_SIZE_LIMIT = 101;
63-
/**
64-
* An extra transaction can be added to a package, as long as it only has one
65-
* ancestor and is no larger than this. Not really any reason to make this
66-
* configurable as it doesn't materially change DoS parameters.
67-
*/
68-
static const unsigned int EXTRA_DESCENDANT_TX_SIZE_LIMIT = 10000;
6963
/** Default for -mempoolexpiry, expiration time for mempool transactions in hours */
7064
static const unsigned int DEFAULT_MEMPOOL_EXPIRY = 336;
71-
/** Maximum kilobytes for transactions to store for processing during reorg */
72-
static const unsigned int MAX_DISCONNECTED_TX_POOL_SIZE = 20000;
7365
/** The maximum size of a blk?????.dat file (since 0.8) */
7466
static const unsigned int MAX_BLOCKFILE_SIZE = 0x8000000; // 128 MiB
75-
/** The pre-allocation chunk size for blk?????.dat files (since 0.8) */
76-
static const unsigned int BLOCKFILE_CHUNK_SIZE = 0x1000000; // 16 MiB
77-
/** The pre-allocation chunk size for rev?????.dat files (since 0.8) */
78-
static const unsigned int UNDOFILE_CHUNK_SIZE = 0x100000; // 1 MiB
7967

8068
/** Maximum number of dedicated script-checking threads allowed */
8169
static const int MAX_SCRIPTCHECK_THREADS = 15;
8270
/** -par default (number of script-checking threads, 0 = auto) */
8371
static const int DEFAULT_SCRIPTCHECK_THREADS = 0;
84-
/** Time to wait (in seconds) between writing blocks/block index to disk. */
85-
static const unsigned int DATABASE_WRITE_INTERVAL = 60 * 60;
86-
/** Time to wait (in seconds) between flushing chainstate to disk. */
87-
static const unsigned int DATABASE_FLUSH_INTERVAL = 24 * 60 * 60;
8872

8973
static const int64_t DEFAULT_MAX_TIP_AGE = 24 * 60 * 60;
90-
/** Maximum age of our tip in seconds for us to be considered current for fee estimation */
91-
static const int64_t MAX_FEE_ESTIMATION_TIP_AGE = 3 * 60 * 60;
9274

9375
static const bool DEFAULT_CHECKPOINTS_ENABLED = true;
9476
static const bool DEFAULT_TXINDEX = false;

0 commit comments

Comments
 (0)