Changeset View
Changeset View
Standalone View
Standalone View
src/chainparams.h
// Copyright (c) 2009-2010 Satoshi Nakamoto | // Copyright (c) 2009-2010 Satoshi Nakamoto | ||||
// Copyright (c) 2009-2016 The Bitcoin Core developers | // Copyright (c) 2009-2016 The Bitcoin Core developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#ifndef BITCOIN_CHAINPARAMS_H | #ifndef BITCOIN_CHAINPARAMS_H | ||||
#define BITCOIN_CHAINPARAMS_H | #define BITCOIN_CHAINPARAMS_H | ||||
#include "chainparamsbase.h" | #include "chainparamsbase.h" | ||||
#include "consensus/params.h" | #include "consensus/params.h" | ||||
#include "primitives/block.h" | #include "primitives/block.h" | ||||
#include "protocol.h" | #include "protocol.h" | ||||
#include <memory> | #include <memory> | ||||
#include <vector> | #include <vector> | ||||
struct CDNSSeedData { | |||||
std::string host; | |||||
bool supportsServiceBitsFiltering; | |||||
CDNSSeedData(const std::string &strHost, | |||||
bool supportsServiceBitsFilteringIn) | |||||
: host(strHost), | |||||
supportsServiceBitsFiltering(supportsServiceBitsFilteringIn) {} | |||||
}; | |||||
struct SeedSpec6 { | struct SeedSpec6 { | ||||
uint8_t addr[16]; | uint8_t addr[16]; | ||||
uint16_t port; | uint16_t port; | ||||
}; | }; | ||||
typedef std::map<int, uint256> MapCheckpoints; | typedef std::map<int, uint256> MapCheckpoints; | ||||
struct CCheckpointData { | struct CCheckpointData { | ||||
Show All 38 Lines | public: | ||||
uint64_t PruneAfterHeight() const { return nPruneAfterHeight; } | uint64_t PruneAfterHeight() const { return nPruneAfterHeight; } | ||||
/** | /** | ||||
* Make miner stop after a block is found. In RPC, don't return until | * Make miner stop after a block is found. In RPC, don't return until | ||||
* nGenProcLimit blocks are generated. | * nGenProcLimit blocks are generated. | ||||
*/ | */ | ||||
bool MineBlocksOnDemand() const { return fMineBlocksOnDemand; } | bool MineBlocksOnDemand() const { return fMineBlocksOnDemand; } | ||||
/** Return the BIP70 network string (main, test or regtest) */ | /** Return the BIP70 network string (main, test or regtest) */ | ||||
std::string NetworkIDString() const { return strNetworkID; } | std::string NetworkIDString() const { return strNetworkID; } | ||||
const std::vector<CDNSSeedData> &DNSSeeds() const { return vSeeds; } | /** Return the list of hostnames to look up for DNS seeds */ | ||||
const std::vector<std::string> &DNSSeeds() const { return vSeeds; } | |||||
const std::vector<uint8_t> &Base58Prefix(Base58Type type) const { | const std::vector<uint8_t> &Base58Prefix(Base58Type type) const { | ||||
return base58Prefixes[type]; | return base58Prefixes[type]; | ||||
} | } | ||||
const std::string &CashAddrPrefix() const { return cashaddrPrefix; } | const std::string &CashAddrPrefix() const { return cashaddrPrefix; } | ||||
const std::vector<SeedSpec6> &FixedSeeds() const { return vFixedSeeds; } | const std::vector<SeedSpec6> &FixedSeeds() const { return vFixedSeeds; } | ||||
const CCheckpointData &Checkpoints() const { return checkpointData; } | const CCheckpointData &Checkpoints() const { return checkpointData; } | ||||
const ChainTxData &TxData() const { return chainTxData; } | const ChainTxData &TxData() const { return chainTxData; } | ||||
protected: | protected: | ||||
CChainParams() {} | CChainParams() {} | ||||
Consensus::Params consensus; | Consensus::Params consensus; | ||||
CMessageHeader::MessageMagic diskMagic; | CMessageHeader::MessageMagic diskMagic; | ||||
CMessageHeader::MessageMagic netMagic; | CMessageHeader::MessageMagic netMagic; | ||||
int nDefaultPort; | int nDefaultPort; | ||||
uint64_t nPruneAfterHeight; | uint64_t nPruneAfterHeight; | ||||
std::vector<CDNSSeedData> vSeeds; | std::vector<std::string> vSeeds; | ||||
std::vector<uint8_t> base58Prefixes[MAX_BASE58_TYPES]; | std::vector<uint8_t> base58Prefixes[MAX_BASE58_TYPES]; | ||||
std::string cashaddrPrefix; | std::string cashaddrPrefix; | ||||
std::string strNetworkID; | std::string strNetworkID; | ||||
CBlock genesis; | CBlock genesis; | ||||
std::vector<SeedSpec6> vFixedSeeds; | std::vector<SeedSpec6> vFixedSeeds; | ||||
bool fDefaultConsistencyChecks; | bool fDefaultConsistencyChecks; | ||||
bool fRequireStandard; | bool fRequireStandard; | ||||
bool fMineBlocksOnDemand; | bool fMineBlocksOnDemand; | ||||
Show All 24 Lines |