6#ifndef BITCOIN_KERNEL_CHAINPARAMS_H
7#define BITCOIN_KERNEL_CHAINPARAMS_H
23#include <unordered_map>
143 [&](
const auto &d) {
return d.height == height; });
145 std::optional<AssumeutxoData>
148 return d.blockhash == blockhash;
159 static std::unique_ptr<const CChainParams>
160 RegTest(
const ChainOptions &options);
161 static std::unique_ptr<const CChainParams>
162 Main(
const ChainOptions &options);
163 static std::unique_ptr<const CChainParams>
164 TestNet(
const ChainOptions &options);
190 friend const std::vector<std::string>
CChainParams defines various tweakable parameters of a given instance of the Bitcoin system.
uint64_t m_assumed_chain_state_size
const CBlock & GenesisBlock() const
bool DefaultConsistencyChecks() const
Default value for -checkmempool and -checkblockindex argument.
const CMessageHeader::MessageMagic & NetMagic() const
const CMessageHeader::MessageMagic & DiskMagic() const
const std::vector< SeedSpec6 > & FixedSeeds() const
std::string NetworkIDString() const
Return the BIP70 network string (main, test or regtest)
uint16_t GetDefaultPort(const std::string &addr) const
bool RequireStandard() const
Policy: Filter transactions that do not match well-defined patterns.
const std::vector< uint8_t > & Base58Prefix(Base58Type type) const
Return the list of hostnames to look up for DNS seeds.
uint64_t m_assumed_blockchain_size
bool IsMockableChain() const
If this chain allows time to be mocked.
CMessageHeader::MessageMagic netMagic
std::vector< uint8_t > base58Prefixes[MAX_BASE58_TYPES]
bool fDefaultConsistencyChecks
std::vector< SeedSpec6 > vFixedSeeds
const ChainTxData & TxData() const
std::optional< AssumeutxoData > AssumeutxoForBlockhash(const BlockHash &blockhash) const
friend const std::vector< std::string > GetRandomizedDNSSeeds(const CChainParams ¶ms)
Return the list of hostnames to look up for DNS seeds.
const Consensus::Params & GetConsensus() const
bool IsTestChain() const
If this chain is exclusively used for testing.
bool MineBlocksOnDemand() const
Whether it is possible to mine blocks on demand (no retargeting)
Consensus::Params consensus
static std::unique_ptr< const CChainParams > TestNet(const ChainOptions &options)
uint16_t GetDefaultPort() const
static std::unique_ptr< const CChainParams > RegTest(const ChainOptions &options)
std::vector< AssumeutxoData > m_assumeutxo_data
const std::string & CashAddrPrefix() const
uint64_t AssumedBlockchainSize() const
Minimum free space (in GB) needed for data directory.
std::string cashaddrPrefix
std::vector< std::string > vSeeds
CMessageHeader::MessageMagic diskMagic
static std::unique_ptr< const CChainParams > Main(const ChainOptions &options)
uint64_t AssumedChainStateSize() const
Minimum free space (in GB) needed for data directory when pruned; Does not include prune target.
uint64_t PruneAfterHeight() const
CCheckpointData checkpointData
std::optional< AssumeutxoData > AssumeutxoForHeight(int height) const
const CCheckpointData & Checkpoints() const
uint64_t nPruneAfterHeight
uint16_t GetDefaultPort(Network net) const
bool SetSpecial(const std::string &addr)
Parse a Tor or I2P address and set this object to it.
enum Network GetNetwork() const
std::map< int, BlockHash > MapCheckpoints
const CCheckpointData & CheckpointData(const std::string &chain)
static constexpr uint16_t I2P_SAM31_PORT
SAM 3.1 and earlier do not support specifying ports and force the port to 0.
Holds configuration for use during UTXO snapshot load and validation.
AssumeutxoHash hash_serialized
The expected hash of the deserialized UTXO set.
BlockHash blockhash
The hash of the base block for this snapshot.
unsigned int nChainTx
Used to populate the nChainTx value, which is used during BlockManager::LoadBlockIndex().
AssumeutxoHash(const uint256 &hash)
A BlockHash is a unqiue identifier for a block.
MapCheckpoints mapCheckpoints
Holds various statistics on transactions within a chain.
Parameters that influence chain consensus.
std::optional< V > FindFirst(const std::vector< V > &vec, const L fnc)