6#ifndef BITCOIN_KERNEL_CHAINPARAMS_H
7#define BITCOIN_KERNEL_CHAINPARAMS_H
24#include <unordered_map>
149 [&](
const auto &d) {
return d.height == height; });
151 std::optional<AssumeutxoData>
154 return d.blockhash == blockhash;
165 static std::unique_ptr<const CChainParams>
166 RegTest(
const ChainOptions &options);
167 static std::unique_ptr<const CChainParams>
168 Main(
const ChainOptions &options);
169 static std::unique_ptr<const CChainParams>
170 TestNet(
const ChainOptions &options);
196 friend std::vector<std::string>
202std::optional<ChainType>
std::string ChainTypeToString(ChainType chain)
CChainParams defines various tweakable parameters of a given instance of the Bitcoin system.
std::string GetChainTypeString() const
Return the chain type string.
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
std::vector< int > GetAvailableSnapshotHeights() const
const CMessageHeader::MessageMagic & DiskMagic() const
const std::vector< SeedSpec6 > & FixedSeeds() const
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
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
friend std::vector< std::string > GetRandomizedDNSSeeds(const CChainParams ¶ms)
Return the list of hostnames to look up for DNS seeds.
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
ChainType GetChainType() const
Return the chain type.
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::optional< ChainType > GetNetworkForMagic(CMessageHeader::MessageMagic &pchMessageStart)
std::map< int, BlockHash > MapCheckpoints
const CCheckpointData & CheckpointData(const ChainType 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)