Changeset View
Changeset View
Standalone View
Standalone View
src/validation.h
Show First 20 Lines • Show All 74 Lines • ▼ Show 20 Lines | |||||
static const unsigned int DEFAULT_MEMPOOL_EXPIRY = 336; | static const unsigned int DEFAULT_MEMPOOL_EXPIRY = 336; | ||||
/** The maximum size of a blk?????.dat file (since 0.8) */ | /** The maximum size of a blk?????.dat file (since 0.8) */ | ||||
static const unsigned int MAX_BLOCKFILE_SIZE = 0x8000000; // 128 MiB | static const unsigned int MAX_BLOCKFILE_SIZE = 0x8000000; // 128 MiB | ||||
/** Maximum number of dedicated script-checking threads allowed */ | /** Maximum number of dedicated script-checking threads allowed */ | ||||
static const int MAX_SCRIPTCHECK_THREADS = 15; | static const int MAX_SCRIPTCHECK_THREADS = 15; | ||||
/** -par default (number of script-checking threads, 0 = auto) */ | /** -par default (number of script-checking threads, 0 = auto) */ | ||||
static const int DEFAULT_SCRIPTCHECK_THREADS = 0; | static const int DEFAULT_SCRIPTCHECK_THREADS = 0; | ||||
/** | |||||
* Number of blocks that can be requested at any given time from a single peer. | |||||
*/ | |||||
static const int MAX_BLOCKS_IN_TRANSIT_PER_PEER = 16; | |||||
/** | |||||
* Timeout in seconds during which a peer must stall block download progress | |||||
* before being disconnected. | |||||
*/ | |||||
static const unsigned int BLOCK_STALLING_TIMEOUT = 2; | |||||
/** | |||||
* Number of headers sent in one getheaders result. We rely on the assumption | |||||
* that if a peer sends less than this number, we reached its tip. Changing this | |||||
* value is a protocol upgrade. | |||||
*/ | |||||
static const unsigned int MAX_HEADERS_RESULTS = 2000; | |||||
/** | |||||
* Maximum depth of blocks we're willing to serve as compact blocks to peers | |||||
* when requested. For older blocks, a regular BLOCK response will be sent. | |||||
*/ | |||||
static const int MAX_CMPCTBLOCK_DEPTH = 5; | |||||
/** | |||||
* Maximum depth of blocks we're willing to respond to GETBLOCKTXN requests for. | |||||
*/ | |||||
static const int MAX_BLOCKTXN_DEPTH = 10; | |||||
/** | |||||
* Size of the "block download window": how far ahead of our current height do | |||||
* we fetch ? Larger windows tolerate larger download speed differences between | |||||
* peer, but increase the potential degree of disordering of blocks on disk | |||||
* (which make reindexing and in the future perhaps pruning harder). We'll | |||||
* probably want to make this a per-peer adaptive value at some point. | |||||
*/ | |||||
static const unsigned int BLOCK_DOWNLOAD_WINDOW = 1024; | |||||
/** Time to wait (in seconds) between writing blocks/block index to disk. */ | /** Time to wait (in seconds) between writing blocks/block index to disk. */ | ||||
static const unsigned int DATABASE_WRITE_INTERVAL = 60 * 60; | static const unsigned int DATABASE_WRITE_INTERVAL = 60 * 60; | ||||
/** Time to wait (in seconds) between flushing chainstate to disk. */ | /** Time to wait (in seconds) between flushing chainstate to disk. */ | ||||
static const unsigned int DATABASE_FLUSH_INTERVAL = 24 * 60 * 60; | static const unsigned int DATABASE_FLUSH_INTERVAL = 24 * 60 * 60; | ||||
/** Block download timeout base, expressed in millionths of the block interval | |||||
* (i.e. 10 min) */ | |||||
static const int64_t BLOCK_DOWNLOAD_TIMEOUT_BASE = 1000000; | |||||
/** | |||||
* Additional block download timeout per parallel downloading peer (i.e. 5 min) | |||||
*/ | |||||
static const int64_t BLOCK_DOWNLOAD_TIMEOUT_PER_PEER = 500000; | |||||
static const int64_t DEFAULT_MAX_TIP_AGE = 24 * 60 * 60; | static const int64_t DEFAULT_MAX_TIP_AGE = 24 * 60 * 60; | ||||
/** | /** | ||||
* Maximum age of our tip in seconds for us to be considered current for fee | * Maximum age of our tip in seconds for us to be considered current for fee | ||||
* estimation. | * estimation. | ||||
*/ | */ | ||||
static const int64_t MAX_FEE_ESTIMATION_TIP_AGE = 3 * 60 * 60; | static const int64_t MAX_FEE_ESTIMATION_TIP_AGE = 3 * 60 * 60; | ||||
static const bool DEFAULT_CHECKPOINTS_ENABLED = true; | static const bool DEFAULT_CHECKPOINTS_ENABLED = true; | ||||
static const bool DEFAULT_TXINDEX = false; | static const bool DEFAULT_TXINDEX = false; | ||||
static const char *const DEFAULT_BLOCKFILTERINDEX = "0"; | static const char *const DEFAULT_BLOCKFILTERINDEX = "0"; | ||||
/** Default for -persistmempool */ | /** Default for -persistmempool */ | ||||
static const bool DEFAULT_PERSIST_MEMPOOL = true; | static const bool DEFAULT_PERSIST_MEMPOOL = true; | ||||
/** Default for using fee filter */ | /** Default for using fee filter */ | ||||
static const bool DEFAULT_FEEFILTER = true; | static const bool DEFAULT_FEEFILTER = true; | ||||
/** | |||||
* Maximum number of headers to announce when relaying blocks with headers | |||||
* message. | |||||
*/ | |||||
static const unsigned int MAX_BLOCKS_TO_ANNOUNCE = 8; | |||||
/** Maximum number of unconnecting headers announcements before DoS score */ | |||||
static const int MAX_UNCONNECTING_HEADERS = 10; | |||||
static const bool DEFAULT_PEERBLOOMFILTERS = true; | static const bool DEFAULT_PEERBLOOMFILTERS = true; | ||||
/** Default for -stopatheight */ | /** Default for -stopatheight */ | ||||
static const int DEFAULT_STOPATHEIGHT = 0; | static const int DEFAULT_STOPATHEIGHT = 0; | ||||
/** Default for -maxreorgdepth */ | /** Default for -maxreorgdepth */ | ||||
static const int DEFAULT_MAX_REORG_DEPTH = 10; | static const int DEFAULT_MAX_REORG_DEPTH = 10; | ||||
/** | /** | ||||
* Default for -finalizationdelay | * Default for -finalizationdelay | ||||
▲ Show 20 Lines • Show All 53 Lines • ▼ Show 20 Lines | |||||
extern bool fPruneMode; | extern bool fPruneMode; | ||||
/** Number of MiB of block files that we're trying to stay below. */ | /** Number of MiB of block files that we're trying to stay below. */ | ||||
extern uint64_t nPruneTarget; | extern uint64_t nPruneTarget; | ||||
/** | /** | ||||
* Block files containing a block-height within MIN_BLOCKS_TO_KEEP of | * Block files containing a block-height within MIN_BLOCKS_TO_KEEP of | ||||
* ::ChainActive().Tip() will not be pruned. | * ::ChainActive().Tip() will not be pruned. | ||||
*/ | */ | ||||
static const unsigned int MIN_BLOCKS_TO_KEEP = 288; | static const unsigned int MIN_BLOCKS_TO_KEEP = 288; | ||||
/** Minimum blocks required to signal NODE_NETWORK_LIMITED */ | |||||
static const unsigned int NODE_NETWORK_LIMITED_MIN_BLOCKS = 288; | |||||
static const signed int DEFAULT_CHECKBLOCKS = 6; | static const signed int DEFAULT_CHECKBLOCKS = 6; | ||||
static const unsigned int DEFAULT_CHECKLEVEL = 3; | static const unsigned int DEFAULT_CHECKLEVEL = 3; | ||||
/** | /** | ||||
* Require that user allocate at least 550 MiB for block & undo files | * Require that user allocate at least 550 MiB for block & undo files | ||||
* (blk???.dat and rev???.dat) | * (blk???.dat and rev???.dat) | ||||
* At 1MB per block, 288 blocks = 288MB. | * At 1MB per block, 288 blocks = 288MB. | ||||
▲ Show 20 Lines • Show All 1,068 Lines • Show Last 20 Lines |