Dash Core Source Documentation (0.16.0.1)

Find detailed information regarding the Dash Core source code.

chainparams.h
Go to the documentation of this file.
1 // Copyright (c) 2009-2010 Satoshi Nakamoto
2 // Copyright (c) 2009-2015 The Bitcoin Core developers
3 // Distributed under the MIT software license, see the accompanying
4 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
5 
6 #ifndef BITCOIN_CHAINPARAMS_H
7 #define BITCOIN_CHAINPARAMS_H
8 
9 #include <chainparamsbase.h>
10 #include <consensus/params.h>
11 #include <primitives/block.h>
12 #include <protocol.h>
13 
14 #include <memory>
15 #include <vector>
16 
17 struct SeedSpec6 {
18  uint8_t addr[16];
19  uint16_t port;
20 };
21 
22 typedef std::map<int, uint256> MapCheckpoints;
23 
26 };
27 
28 struct ChainTxData {
29  int64_t nTime;
30  int64_t nTxCount;
31  double dTxRate;
32 };
33 
42 {
43 public:
44  enum Base58Type {
47  SECRET_KEY, // BIP16
48  EXT_PUBLIC_KEY, // BIP32
49  EXT_SECRET_KEY, // BIP32
50 
52  };
53 
54  const Consensus::Params& GetConsensus() const { return consensus; }
56  int GetDefaultPort() const { return nDefaultPort; }
57 
58  const CBlock& GenesisBlock() const { return genesis; }
59  const CBlock& DevNetGenesisBlock() const { return devnetGenesis; }
63  bool RequireStandard() const { return fRequireStandard; }
66  uint64_t PruneAfterHeight() const { return nPruneAfterHeight; }
68  bool MineBlocksOnDemand() const { return fMineBlocksOnDemand; }
72  bool AllowMultiplePorts() const { return fAllowMultiplePorts; }
76  std::string NetworkIDString() const { return strNetworkID; }
78  const std::vector<std::string>& DNSSeeds() const { return vSeeds; }
79  const std::vector<unsigned char>& Base58Prefix(Base58Type type) const { return base58Prefixes[type]; }
80  int ExtCoinType() const { return nExtCoinType; }
81  const std::vector<SeedSpec6>& FixedSeeds() const { return vFixedSeeds; }
82  const CCheckpointData& Checkpoints() const { return checkpointData; }
83  const ChainTxData& TxData() const { return chainTxData; }
84  void UpdateVersionBitsParameters(Consensus::DeploymentPos d, int64_t nStartTime, int64_t nTimeout, int64_t nWindowSize, int64_t nThresholdStart, int64_t nThresholdMin, int64_t nFalloffCoeff);
85  void UpdateDIP3Parameters(int nActivationHeight, int nEnforcementHeight);
86  void UpdateBudgetParameters(int nMasternodePaymentsStartBlock, int nBudgetPaymentsStartBlock, int nSuperblockStartBlock);
87  void UpdateSubsidyAndDiffParams(int nMinimumDifficultyBlocks, int nHighSubsidyBlocks, int nHighSubsidyFactor);
89  void UpdateLLMQTestParams(int size, int threshold);
90  void UpdateLLMQDevnetParams(int size, int threshold);
91  int PoolMinParticipants() const { return nPoolMinParticipants; }
93  int PoolMaxParticipants() const { return nPoolMaxParticipants; }
96  const std::vector<std::string>& SporkAddresses() const { return vSporkAddresses; }
97  int MinSporkKeys() const { return nMinSporkKeys; }
99 protected:
101 
106  std::vector<std::string> vSeeds;
107  std::vector<unsigned char> base58Prefixes[MAX_BASE58_TYPES];
109  std::string strNetworkID;
112  std::vector<SeedSpec6> vFixedSeeds;
127  std::vector<std::string> vSporkAddresses;
130 };
131 
137 std::unique_ptr<CChainParams> CreateChainParams(const std::string& chain);
138 
143 const CChainParams &Params();
144 
149 void SelectParams(const std::string& chain);
150 
154 void UpdateVersionBitsParameters(Consensus::DeploymentPos d, int64_t nStartTime, int64_t nTimeout, int64_t nWindowSize, int64_t nThresholdStart, int64_t nThresholdMin, int64_t nFalloffCoeff);
155 
159 void UpdateDIP3Parameters(int nActivationHeight, int nEnforcementHeight);
160 
164 void UpdateBudgetParameters(int nMasternodePaymentsStartBlock, int nBudgetPaymentsStartBlock, int nSuperblockStartBlock);
165 
169 void UpdateDevnetSubsidyAndDiffParams(int nMinimumDifficultyBlocks, int nHighSubsidyBlocks, int nHighSubsidyFactor);
170 
175 
179 void UpdateLLMQTestParams(int size, int threshold);
180 
184 void UpdateLLMQDevnetParams(int size, int threshold);
185 
186 #endif // BITCOIN_CHAINPARAMS_H
const std::vector< std::string > & DNSSeeds() const
Return the list of hostnames to look up for DNS seeds.
Definition: chainparams.h:78
std::string NetworkIDString() const
Return the BIP70 network string (main, test or regtest)
Definition: chainparams.h:76
bool fMineBlocksOnDemand
Definition: chainparams.h:116
void UpdateSubsidyAndDiffParams(int nMinimumDifficultyBlocks, int nHighSubsidyBlocks, int nHighSubsidyFactor)
bool BIP9CheckMasternodesUpgraded() const
Definition: chainparams.h:98
int PoolMaxParticipants() const
Definition: chainparams.h:93
double dTxRate
Definition: chainparams.h:31
std::map< int, uint256 > MapCheckpoints
Definition: chainparams.h:22
Definition: block.h:72
std::vector< unsigned char > base58Prefixes[MAX_BASE58_TYPES]
Definition: chainparams.h:107
void UpdateDIP3Parameters(int nActivationHeight, int nEnforcementHeight)
int nFulfilledRequestExpireTime
Definition: chainparams.h:126
void UpdateVersionBitsParameters(Consensus::DeploymentPos d, int64_t nStartTime, int64_t nTimeout, int64_t nWindowSize, int64_t nThresholdStart, int64_t nThresholdMin, int64_t nFalloffCoeff)
Allows modifying the Version Bits regtest parameters.
bool DefaultConsistencyChecks() const
Default value for -checkmempool and -checkblockindex argument.
Definition: chainparams.h:61
const CBlock & GenesisBlock() const
Definition: chainparams.h:58
CChainParams defines various tweakable parameters of a given instance of the Dash system...
Definition: chainparams.h:41
CBlock genesis
Definition: chainparams.h:110
int ExtCoinType() const
Definition: chainparams.h:80
int64_t nTime
Definition: chainparams.h:29
const CCheckpointData & Checkpoints() const
Definition: chainparams.h:82
const std::vector< std::string > & SporkAddresses() const
Definition: chainparams.h:96
CMessageHeader::MessageStartChars pchMessageStart
Definition: chainparams.h:103
void UpdateLLMQChainLocks(Consensus::LLMQType llmqType)
ChainTxData chainTxData
Definition: chainparams.h:121
int64_t nTxCount
Definition: chainparams.h:30
int nPoolNewMinParticipants
Definition: chainparams.h:123
LLMQType
Definition: params.h:48
uint64_t PruneAfterHeight() const
Definition: chainparams.h:66
bool fBIP9CheckMasternodesUpgraded
Definition: chainparams.h:129
int nPoolMaxParticipants
Definition: chainparams.h:124
uint16_t port
Definition: chainparams.h:19
bool MineBlocksOnDemand() const
Make miner stop after a block is found.
Definition: chainparams.h:68
DeploymentPos
Definition: params.h:15
bool fRequireStandard
Definition: chainparams.h:114
void UpdateBudgetParameters(int nMasternodePaymentsStartBlock, int nBudgetPaymentsStartBlock, int nSuperblockStartBlock)
Allows modifying the budget regtest parameters.
int MinSporkKeys() const
Definition: chainparams.h:97
int PoolNewMinParticipants() const
Definition: chainparams.h:92
void UpdateDevnetSubsidyAndDiffParams(int nMinimumDifficultyBlocks, int nHighSubsidyBlocks, int nHighSubsidyFactor)
Allows modifying the subsidy and difficulty devnet parameters.
void SelectParams(const std::string &chain)
Sets the params returned by Params() to those for the given BIP70 chain name.
std::vector< std::string > vSeeds
Definition: chainparams.h:106
const CMessageHeader::MessageStartChars & MessageStart() const
Definition: chainparams.h:55
int GetDefaultPort() const
Definition: chainparams.h:56
void UpdateLLMQTestParams(int size, int threshold)
Allows modifying parameters of the test LLMQ.
Parameters that influence chain consensus.
Definition: params.h:130
bool RequireRoutableExternalIP() const
Require addresses specified with "-externalip" parameter to be routable.
Definition: chainparams.h:65
bool fRequireRoutableExternalIP
Definition: chainparams.h:115
int nLLMQConnectionRetryTimeout
Definition: chainparams.h:119
void UpdateLLMQTestParams(int size, int threshold)
unsigned char MessageStartChars[MESSAGE_START_SIZE]
Definition: protocol.h:38
bool AllowMultipleAddressesFromGroup() const
Allow multiple addresses to be selected from the same network group (e.g.
Definition: chainparams.h:70
void UpdateVersionBitsParameters(Consensus::DeploymentPos d, int64_t nStartTime, int64_t nTimeout, int64_t nWindowSize, int64_t nThresholdStart, int64_t nThresholdMin, int64_t nFalloffCoeff)
Definition: chainparams.cpp:85
bool AllowMultiplePorts() const
Allow nodes with the same address and multiple ports.
Definition: chainparams.h:72
bool RequireStandard() const
Policy: Filter transactions that do not match well-defined patterns.
Definition: chainparams.h:63
void UpdateDevnetLLMQChainLocks(Consensus::LLMQType llmqType)
Allows modifying the LLMQ type for ChainLocks.
const CChainParams & Params()
Return the currently selected parameters.
const ChainTxData & TxData() const
Definition: chainparams.h:83
std::vector< SeedSpec6 > vFixedSeeds
Definition: chainparams.h:112
int nPoolNewMaxParticipants
Definition: chainparams.h:125
MapCheckpoints mapCheckpoints
Definition: chainparams.h:25
bool fAllowMultipleAddressesFromGroup
Definition: chainparams.h:117
Consensus::Params consensus
Definition: chainparams.h:102
std::vector< std::string > vSporkAddresses
Definition: chainparams.h:127
int FulfilledRequestExpireTime() const
Definition: chainparams.h:95
std::string strNetworkID
Definition: chainparams.h:109
const std::vector< SeedSpec6 > & FixedSeeds() const
Definition: chainparams.h:81
uint64_t nPruneAfterHeight
Definition: chainparams.h:105
void UpdateLLMQDevnetParams(int size, int threshold)
CBlock devnetGenesis
Definition: chainparams.h:111
void UpdateBudgetParameters(int nMasternodePaymentsStartBlock, int nBudgetPaymentsStartBlock, int nSuperblockStartBlock)
const Consensus::Params & GetConsensus() const
Definition: chainparams.h:54
const CBlock & DevNetGenesisBlock() const
Definition: chainparams.h:59
uint8_t addr[16]
Definition: chainparams.h:18
void UpdateDIP3Parameters(int nActivationHeight, int nEnforcementHeight)
Allows modifying the DIP3 activation and enforcement height.
CCheckpointData checkpointData
Definition: chainparams.h:120
std::unique_ptr< CChainParams > CreateChainParams(const std::string &chain)
Creates and returns a std::unique_ptr<CChainParams> of the chosen chain.
int nPoolMinParticipants
Definition: chainparams.h:122
bool fAllowMultiplePorts
Definition: chainparams.h:118
bool fDefaultConsistencyChecks
Definition: chainparams.h:113
int PoolNewMaxParticipants() const
Definition: chainparams.h:94
int PoolMinParticipants() const
Definition: chainparams.h:91
void UpdateLLMQDevnetParams(int size, int threshold)
Allows modifying parameters of the devnet LLMQ.
const std::vector< unsigned char > & Base58Prefix(Base58Type type) const
Definition: chainparams.h:79
int LLMQConnectionRetryTimeout() const
How long to wait until we allow retrying of a LLMQ connection.
Definition: chainparams.h:74
Released under the MIT license