@@ -60,57 +60,15 @@ static const unsigned int DEFAULT_ANCESTOR_SIZE_LIMIT = 101;
60
60
static const unsigned int DEFAULT_DESCENDANT_LIMIT = 25 ;
61
61
/* * Default for -limitdescendantsize, maximum kilobytes of in-mempool descendants */
62
62
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 ;
69
63
/* * Default for -mempoolexpiry, expiration time for mempool transactions in hours */
70
64
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 ;
73
65
/* * The maximum size of a blk?????.dat file (since 0.8) */
74
66
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
79
-
80
67
/* * Maximum number of dedicated script-checking threads allowed */
81
68
static const int MAX_SCRIPTCHECK_THREADS = 15 ;
82
69
/* * -par default (number of script-checking threads, 0 = auto) */
83
70
static const int DEFAULT_SCRIPTCHECK_THREADS = 0 ;
84
- /* * Number of blocks that can be requested at any given time from a single peer. */
85
- static const int MAX_BLOCKS_IN_TRANSIT_PER_PEER = 16 ;
86
- /* * Timeout in seconds during which a peer must stall block download progress before being disconnected. */
87
- static const unsigned int BLOCK_STALLING_TIMEOUT = 2 ;
88
- /* * Number of headers sent in one getheaders result. We rely on the assumption that if a peer sends
89
- * less than this number, we reached its tip. Changing this value is a protocol upgrade. */
90
- static const unsigned int MAX_HEADERS_RESULTS = 2000 ;
91
- /* * Maximum depth of blocks we're willing to serve as compact blocks to peers
92
- * when requested. For older blocks, a regular BLOCK response will be sent. */
93
- static const int MAX_CMPCTBLOCK_DEPTH = 5 ;
94
- /* * Maximum depth of blocks we're willing to respond to GETBLOCKTXN requests for. */
95
- static const int MAX_BLOCKTXN_DEPTH = 10 ;
96
- /* * Size of the "block download window": how far ahead of our current height do we fetch?
97
- * Larger windows tolerate larger download speed differences between peer, but increase the potential
98
- * degree of disordering of blocks on disk (which make reindexing and pruning harder). We'll probably
99
- * want to make this a per-peer adaptive value at some point. */
100
- static const unsigned int BLOCK_DOWNLOAD_WINDOW = 1024 ;
101
- /* * Time to wait (in seconds) between writing blocks/block index to disk. */
102
- static const unsigned int DATABASE_WRITE_INTERVAL = 60 * 60 ;
103
- /* * Time to wait (in seconds) between flushing chainstate to disk. */
104
- static const unsigned int DATABASE_FLUSH_INTERVAL = 24 * 60 * 60 ;
105
- /* * Block download timeout base, expressed in millionths of the block interval (i.e. 10 min) */
106
- static const int64_t BLOCK_DOWNLOAD_TIMEOUT_BASE = 1000000 ;
107
- /* * Additional block download timeout per parallel downloading peer (i.e. 5 min) */
108
- static const int64_t BLOCK_DOWNLOAD_TIMEOUT_PER_PEER = 500000 ;
109
-
110
71
static const int64_t DEFAULT_MAX_TIP_AGE = 24 * 60 * 60 ;
111
- /* * Maximum age of our tip in seconds for us to be considered current for fee estimation */
112
- static const int64_t MAX_FEE_ESTIMATION_TIP_AGE = 3 * 60 * 60 ;
113
-
114
72
static const bool DEFAULT_CHECKPOINTS_ENABLED = true ;
115
73
static const bool DEFAULT_TXINDEX = false ;
116
74
static const char * const DEFAULT_BLOCKFILTERINDEX = " 0" ;
@@ -119,15 +77,21 @@ static const unsigned int DEFAULT_BANSCORE_THRESHOLD = 100;
119
77
static const bool DEFAULT_PERSIST_MEMPOOL = true ;
120
78
/* * Default for using fee filter */
121
79
static const bool DEFAULT_FEEFILTER = true ;
122
-
123
- /* * Maximum number of headers to announce when relaying blocks with headers message.*/
124
- static const unsigned int MAX_BLOCKS_TO_ANNOUNCE = 8 ;
125
-
126
- /* * Maximum number of unconnecting headers announcements before DoS score */
127
- static const int MAX_UNCONNECTING_HEADERS = 10 ;
128
-
129
80
/* * Default for -stopatheight */
130
81
static const int DEFAULT_STOPATHEIGHT = 0 ;
82
+ /* * Block files containing a block-height within MIN_BLOCKS_TO_KEEP of ::ChainActive().Tip() will not be pruned. */
83
+ static const unsigned int MIN_BLOCKS_TO_KEEP = 288 ;
84
+ static const signed int DEFAULT_CHECKBLOCKS = 6 ;
85
+ static const unsigned int DEFAULT_CHECKLEVEL = 3 ;
86
+ // Require that user allocate at least 550 MiB for block & undo files (blk???.dat and rev???.dat)
87
+ // At 1MB per block, 288 blocks = 288MB.
88
+ // Add 15% for Undo data = 331MB
89
+ // Add 20% for Orphan block rate = 397MB
90
+ // We want the low water mark after pruning to be at least 397 MB and since we prune in
91
+ // full block file chunks, we need the high water mark which triggers the prune to be
92
+ // one 128MB block file + added 15% undo data = 147MB greater for a total of 545MB
93
+ // Setting the target to >= 550 MiB will make it likely we can respect the target.
94
+ static const uint64_t MIN_DISK_SPACE_FOR_BLOCK_FILES = 550 * 1024 * 1024 ;
131
95
132
96
struct BlockHasher
133
97
{
@@ -175,23 +139,6 @@ extern bool fHavePruned;
175
139
extern bool fPruneMode ;
176
140
/* * Number of MiB of block files that we're trying to stay below. */
177
141
extern uint64_t nPruneTarget;
178
- /* * Block files containing a block-height within MIN_BLOCKS_TO_KEEP of ::ChainActive().Tip() will not be pruned. */
179
- static const unsigned int MIN_BLOCKS_TO_KEEP = 288 ;
180
- /* * Minimum blocks required to signal NODE_NETWORK_LIMITED */
181
- static const unsigned int NODE_NETWORK_LIMITED_MIN_BLOCKS = 288 ;
182
-
183
- static const signed int DEFAULT_CHECKBLOCKS = 6 ;
184
- static const unsigned int DEFAULT_CHECKLEVEL = 3 ;
185
-
186
- // Require that user allocate at least 550 MiB for block & undo files (blk???.dat and rev???.dat)
187
- // At 1MB per block, 288 blocks = 288MB.
188
- // Add 15% for Undo data = 331MB
189
- // Add 20% for Orphan block rate = 397MB
190
- // We want the low water mark after pruning to be at least 397 MB and since we prune in
191
- // full block file chunks, we need the high water mark which triggers the prune to be
192
- // one 128MB block file + added 15% undo data = 147MB greater for a total of 545MB
193
- // Setting the target to >= 550 MiB will make it likely we can respect the target.
194
- static const uint64_t MIN_DISK_SPACE_FOR_BLOCK_FILES = 550 * 1024 * 1024 ;
195
142
196
143
/* *
197
144
* Process an incoming block. This only returns after the best known valid
0 commit comments