Changeset View
Changeset View
Standalone View
Standalone View
src/defaults.h
- This file was added.
#ifndef BITCOIN_DEFAULTS_H | |||||
#define BITCOIN_DEFAULTS_H | |||||
#include "amount.h" | |||||
#include "primitives/transaction.h" | |||||
#define MIN_TRANSACTION_SIZE \ | |||||
(::GetSerializeSize(CTransaction(), SER_NETWORK, PROTOCOL_VERSION)) | |||||
/** Default for DEFAULT_WHITELISTRELAY. */ | |||||
static const bool DEFAULT_WHITELISTRELAY = true; | |||||
/** Default for DEFAULT_WHITELISTFORCERELAY. */ | |||||
static const bool DEFAULT_WHITELISTFORCERELAY = true; | |||||
/** Default for -minrelaytxfee, minimum relay fee for transactions */ | |||||
static const Amount DEFAULT_MIN_RELAY_TX_FEE_PER_KB(1000 * SATOSHI); | |||||
/** Default for -excessutxocharge for transactions transactions */ | |||||
static const Amount DEFAULT_UTXO_FEE = Amount::zero(); | |||||
//! -maxtxfee default | |||||
static const Amount DEFAULT_TRANSACTION_MAXFEE(COIN / 10); | |||||
//! Discourage users to set fees higher than this amount (in satoshis) per kB | |||||
static const Amount HIGH_TX_FEE_PER_KB(COIN / 100); | |||||
/** -maxtxfee will warn if called with a higher fee than this amount (in | |||||
* satoshis */ | |||||
static const Amount HIGH_MAX_TX_FEE(100 * HIGH_TX_FEE_PER_KB); | |||||
/** Default for -limitancestorcount, max number of in-mempool ancestors */ | |||||
static const unsigned int DEFAULT_ANCESTOR_LIMIT = 25; | |||||
/** Default for -limitancestorsize, maximum kilobytes of tx + all in-mempool | |||||
* ancestors */ | |||||
static const unsigned int DEFAULT_ANCESTOR_SIZE_LIMIT = 101; | |||||
/** Default for -limitdescendantcount, max number of in-mempool descendants */ | |||||
static const unsigned int DEFAULT_DESCENDANT_LIMIT = 25; | |||||
/** Default for -limitdescendantsize, maximum kilobytes of in-mempool | |||||
* descendants */ | |||||
static const unsigned int DEFAULT_DESCENDANT_SIZE_LIMIT = 101; | |||||
/** Default for -mempoolexpiry, expiration time for mempool transactions in | |||||
* hours */ | |||||
static const unsigned int DEFAULT_MEMPOOL_EXPIRY = 336; | |||||
/** The maximum size of a blk?????.dat file (since 0.8) */ | |||||
static const unsigned int MAX_BLOCKFILE_SIZE = 0x8000000; // 128 MiB | |||||
/** The pre-allocation chunk size for blk?????.dat files (since 0.8) */ | |||||
static const unsigned int BLOCKFILE_CHUNK_SIZE = 0x1000000; // 16 MiB | |||||
/** The pre-allocation chunk size for rev?????.dat files (since 0.8) */ | |||||
static const unsigned int UNDOFILE_CHUNK_SIZE = 0x100000; // 1 MiB | |||||
/** Maximum number of script-checking threads allowed */ | |||||
static const int MAX_SCRIPTCHECK_THREADS = 16; | |||||
/** -par default (number of script-checking threads, 0 = auto) */ | |||||
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. */ | |||||
static const unsigned int DATABASE_WRITE_INTERVAL = 60 * 60; | |||||
/** Time to wait (in seconds) between flushing chainstate to disk. */ | |||||
static const unsigned int DATABASE_FLUSH_INTERVAL = 24 * 60 * 60; | |||||
/** Maximum length of reject messages. */ | |||||
static const unsigned int MAX_REJECT_MESSAGE_LENGTH = 111; | |||||
/** Average delay between local address broadcasts in seconds. */ | |||||
static const unsigned int AVG_LOCAL_ADDRESS_BROADCAST_INTERVAL = 24 * 24 * 60; | |||||
/** Average delay between peer address broadcasts in seconds. */ | |||||
static const unsigned int AVG_ADDRESS_BROADCAST_INTERVAL = 30; | |||||
/** | |||||
* Average delay between trickled inventory transmissions in seconds. | |||||
* Blocks and whitelisted receivers bypass this, outbound peers get half this | |||||
* delay. | |||||
*/ | |||||
static const unsigned int INVENTORY_BROADCAST_INTERVAL = 5; | |||||
/** | |||||
* Maximum number of inventory items to send per transmission. | |||||
* Limits the impact of low-fee transaction floods. | |||||
*/ | |||||
static const unsigned int INVENTORY_BROADCAST_MAX_PER_MB = | |||||
7 * INVENTORY_BROADCAST_INTERVAL; | |||||
/** Average delay between feefilter broadcasts in seconds. */ | |||||
static const unsigned int AVG_FEEFILTER_BROADCAST_INTERVAL = 10 * 60; | |||||
/** Maximum feefilter broadcast delay after significant change. */ | |||||
static const unsigned int MAX_FEEFILTER_CHANGE_DELAY = 5 * 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 unsigned int DEFAULT_LIMITFREERELAY = 0; | |||||
static const bool DEFAULT_RELAYPRIORITY = true; | |||||
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 | |||||
* estimation. | |||||
*/ | |||||
static const int64_t MAX_FEE_ESTIMATION_TIP_AGE = 3 * 60 * 60; | |||||
/** Default for -permitbaremultisig */ | |||||
static const bool DEFAULT_PERMIT_BAREMULTISIG = true; | |||||
static const bool DEFAULT_CHECKPOINTS_ENABLED = true; | |||||
static const bool DEFAULT_TXINDEX = false; | |||||
static const unsigned int DEFAULT_BANSCORE_THRESHOLD = 100; | |||||
/** Default for -persistmempool */ | |||||
static const bool DEFAULT_PERSIST_MEMPOOL = true; | |||||
/** Default for using fee filter */ | |||||
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; | |||||
/** Default for -stopatheight */ | |||||
static const int DEFAULT_STOPATHEIGHT = 0; | |||||
#endif | |||||
No newline at end of file |