Changeset View
Changeset View
Standalone View
Standalone View
src/chainparams.cpp
// Copyright (c) 2010 Satoshi Nakamoto | // Copyright (c) 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. | ||||
#include "chainparams.h" | #include "chainparams.h" | ||||
#include "consensus/merkle.h" | #include "consensus/merkle.h" | ||||
#include "tinyformat.h" | #include "tinyformat.h" | ||||
#include "util.h" | #include "util.h" | ||||
#include "utilstrencodings.h" | #include "utilstrencodings.h" | ||||
#include <cassert> | #include <cassert> | ||||
#include "chainparamsseeds.h" | #include "chainparamsseeds.h" | ||||
// Far into the future. | |||||
static const std::string ANTI_REPLAY_COMMITMENT = | |||||
"Bitcoin: A Peer-to-Peer Electronic Cash System"; | |||||
static std::vector<uint8_t> GetAntiReplayCommitment() { | |||||
return std::vector<uint8_t>(std::begin(ANTI_REPLAY_COMMITMENT), | |||||
std::end(ANTI_REPLAY_COMMITMENT)); | |||||
} | |||||
static CBlock CreateGenesisBlock(const char *pszTimestamp, | static CBlock CreateGenesisBlock(const char *pszTimestamp, | ||||
const CScript &genesisOutputScript, | const CScript &genesisOutputScript, | ||||
uint32_t nTime, uint32_t nNonce, | uint32_t nTime, uint32_t nNonce, | ||||
uint32_t nBits, int32_t nVersion, | uint32_t nBits, int32_t nVersion, | ||||
const Amount genesisReward) { | const Amount genesisReward) { | ||||
CMutableTransaction txNew; | CMutableTransaction txNew; | ||||
txNew.nVersion = 1; | txNew.nVersion = 1; | ||||
txNew.vin.resize(1); | txNew.vin.resize(1); | ||||
▲ Show 20 Lines • Show All 67 Lines • ▼ Show 20 Lines | CMainParams() { | ||||
consensus.nSubsidyHalvingInterval = 210000; | consensus.nSubsidyHalvingInterval = 210000; | ||||
consensus.BIP34Height = 227931; | consensus.BIP34Height = 227931; | ||||
consensus.BIP34Hash = uint256S( | consensus.BIP34Hash = uint256S( | ||||
"000000000000024b89b42a942fe0d9fea3bb44ab7bd1b19115dd6a759c0808b8"); | "000000000000024b89b42a942fe0d9fea3bb44ab7bd1b19115dd6a759c0808b8"); | ||||
// 000000000000000004c2b624ed5d7756c508d90fd0da2c7c679febfa6c4735f0 | // 000000000000000004c2b624ed5d7756c508d90fd0da2c7c679febfa6c4735f0 | ||||
consensus.BIP65Height = 388381; | consensus.BIP65Height = 388381; | ||||
// 00000000000000000379eaa19dce8c9b722d46ae6a57c2f1a988119488b50931 | // 00000000000000000379eaa19dce8c9b722d46ae6a57c2f1a988119488b50931 | ||||
consensus.BIP66Height = 363725; | consensus.BIP66Height = 363725; | ||||
consensus.antiReplayOpReturnSunsetHeight = 530000; | |||||
consensus.antiReplayOpReturnCommitment = GetAntiReplayCommitment(); | |||||
consensus.powLimit = uint256S( | consensus.powLimit = uint256S( | ||||
"00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); | "00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); | ||||
// two weeks | // two weeks | ||||
consensus.nPowTargetTimespan = 14 * 24 * 60 * 60; | consensus.nPowTargetTimespan = 14 * 24 * 60 * 60; | ||||
consensus.nPowTargetSpacing = 10 * 60; | consensus.nPowTargetSpacing = 10 * 60; | ||||
consensus.fPowAllowMinDifficultyBlocks = false; | consensus.fPowAllowMinDifficultyBlocks = false; | ||||
consensus.fPowNoRetargeting = false; | consensus.fPowNoRetargeting = false; | ||||
// 95% of 2016 | // 95% of 2016 | ||||
▲ Show 20 Lines • Show All 159 Lines • ▼ Show 20 Lines | CTestNetParams() { | ||||
consensus.nSubsidyHalvingInterval = 210000; | consensus.nSubsidyHalvingInterval = 210000; | ||||
consensus.BIP34Height = 21111; | consensus.BIP34Height = 21111; | ||||
consensus.BIP34Hash = uint256S( | consensus.BIP34Hash = uint256S( | ||||
"0000000023b3a96d3484e5abb3755c413e7d41500f8e2a5c3f0dd01299cd8ef8"); | "0000000023b3a96d3484e5abb3755c413e7d41500f8e2a5c3f0dd01299cd8ef8"); | ||||
// 00000000007f6655f22f98e72ed80d8b06dc761d5da09df0fa1dc4be4f861eb6 | // 00000000007f6655f22f98e72ed80d8b06dc761d5da09df0fa1dc4be4f861eb6 | ||||
consensus.BIP65Height = 581885; | consensus.BIP65Height = 581885; | ||||
// 000000002104c8c45e99a8853285a3b592602a3ccde2b832481da85e9e4ba182 | // 000000002104c8c45e99a8853285a3b592602a3ccde2b832481da85e9e4ba182 | ||||
consensus.BIP66Height = 330776; | consensus.BIP66Height = 330776; | ||||
consensus.antiReplayOpReturnSunsetHeight = 1250000; | |||||
consensus.antiReplayOpReturnCommitment = GetAntiReplayCommitment(); | |||||
consensus.powLimit = uint256S( | consensus.powLimit = uint256S( | ||||
"00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); | "00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); | ||||
// two weeks | // two weeks | ||||
consensus.nPowTargetTimespan = 14 * 24 * 60 * 60; | consensus.nPowTargetTimespan = 14 * 24 * 60 * 60; | ||||
consensus.nPowTargetSpacing = 10 * 60; | consensus.nPowTargetSpacing = 10 * 60; | ||||
consensus.fPowAllowMinDifficultyBlocks = true; | consensus.fPowAllowMinDifficultyBlocks = true; | ||||
consensus.fPowNoRetargeting = false; | consensus.fPowNoRetargeting = false; | ||||
// 75% for testchains | // 75% for testchains | ||||
▲ Show 20 Lines • Show All 121 Lines • ▼ Show 20 Lines | CRegTestParams() { | ||||
// BIP34 has not activated on regtest (far in the future so block v1 are | // BIP34 has not activated on regtest (far in the future so block v1 are | ||||
// not rejected in tests) | // not rejected in tests) | ||||
consensus.BIP34Height = 100000000; | consensus.BIP34Height = 100000000; | ||||
consensus.BIP34Hash = uint256(); | consensus.BIP34Hash = uint256(); | ||||
// BIP65 activated on regtest (Used in rpc activation tests) | // BIP65 activated on regtest (Used in rpc activation tests) | ||||
consensus.BIP65Height = 1351; | consensus.BIP65Height = 1351; | ||||
// BIP66 activated on regtest (Used in rpc activation tests) | // BIP66 activated on regtest (Used in rpc activation tests) | ||||
consensus.BIP66Height = 1251; | consensus.BIP66Height = 1251; | ||||
consensus.antiReplayOpReturnSunsetHeight = 530000; | |||||
consensus.antiReplayOpReturnCommitment = GetAntiReplayCommitment(); | |||||
consensus.powLimit = uint256S( | consensus.powLimit = uint256S( | ||||
"7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); | "7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); | ||||
// two weeks | // two weeks | ||||
consensus.nPowTargetTimespan = 14 * 24 * 60 * 60; | consensus.nPowTargetTimespan = 14 * 24 * 60 * 60; | ||||
consensus.nPowTargetSpacing = 10 * 60; | consensus.nPowTargetSpacing = 10 * 60; | ||||
consensus.fPowAllowMinDifficultyBlocks = true; | consensus.fPowAllowMinDifficultyBlocks = true; | ||||
consensus.fPowNoRetargeting = true; | consensus.fPowNoRetargeting = true; | ||||
// 75% for testchains | // 75% for testchains | ||||
▲ Show 20 Lines • Show All 110 Lines • Show Last 20 Lines |