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 | ||||
// Copyright (c) 2017-2020 The Bitcoin developers | // Copyright (c) 2017-2020 The Bitcoin 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 <chainparamsconstants.h> | #include <chainparamsconstants.h> | ||||
#include <chainparamsseeds.h> | #include <chainparamsseeds.h> | ||||
#include <consensus/merkle.h> | #include <consensus/merkle.h> | ||||
#include <currencyunit.h> | |||||
#include <network.h> | #include <network.h> | ||||
#include <tinyformat.h> | #include <tinyformat.h> | ||||
#include <util/strencodings.h> | #include <util/strencodings.h> | ||||
#include <util/system.h> | #include <util/system.h> | ||||
#include <cassert> | #include <cassert> | ||||
static CBlock CreateGenesisBlock(const char *pszTimestamp, | static CBlock CreateGenesisBlock(const char *pszTimestamp, | ||||
▲ Show 20 Lines • Show All 179 Lines • ▼ Show 20 Lines | CMainParams() { | ||||
vSeeds.emplace_back("seeder.fabien.cash"); | vSeeds.emplace_back("seeder.fabien.cash"); | ||||
base58Prefixes[PUBKEY_ADDRESS] = std::vector<uint8_t>(1, 0); | base58Prefixes[PUBKEY_ADDRESS] = std::vector<uint8_t>(1, 0); | ||||
base58Prefixes[SCRIPT_ADDRESS] = std::vector<uint8_t>(1, 5); | base58Prefixes[SCRIPT_ADDRESS] = std::vector<uint8_t>(1, 5); | ||||
base58Prefixes[SECRET_KEY] = std::vector<uint8_t>(1, 128); | base58Prefixes[SECRET_KEY] = std::vector<uint8_t>(1, 128); | ||||
base58Prefixes[EXT_PUBLIC_KEY] = {0x04, 0x88, 0xB2, 0x1E}; | base58Prefixes[EXT_PUBLIC_KEY] = {0x04, 0x88, 0xB2, 0x1E}; | ||||
base58Prefixes[EXT_SECRET_KEY] = {0x04, 0x88, 0xAD, 0xE4}; | base58Prefixes[EXT_SECRET_KEY] = {0x04, 0x88, 0xAD, 0xE4}; | ||||
cashaddrPrefix = | cashaddrPrefix = | ||||
gArgs.GetBoolArg("-ecash", false) ? "ecash" : "bitcoincash"; | gArgs.GetBoolArg("-ecash", DEFAULT_ECASH) ? "ecash" : "bitcoincash"; | ||||
vFixedSeeds = std::vector<SeedSpec6>( | vFixedSeeds = std::vector<SeedSpec6>( | ||||
pnSeed6_main, pnSeed6_main + ARRAYLEN(pnSeed6_main)); | pnSeed6_main, pnSeed6_main + ARRAYLEN(pnSeed6_main)); | ||||
fDefaultConsistencyChecks = false; | fDefaultConsistencyChecks = false; | ||||
fRequireStandard = true; | fRequireStandard = true; | ||||
m_is_test_chain = false; | m_is_test_chain = false; | ||||
m_is_mockable_chain = false; | m_is_mockable_chain = false; | ||||
▲ Show 20 Lines • Show All 131 Lines • ▼ Show 20 Lines | CTestNetParams() { | ||||
vSeeds.emplace_back("testnet-seeder.fabien.cash"); | vSeeds.emplace_back("testnet-seeder.fabien.cash"); | ||||
base58Prefixes[PUBKEY_ADDRESS] = std::vector<uint8_t>(1, 111); | base58Prefixes[PUBKEY_ADDRESS] = std::vector<uint8_t>(1, 111); | ||||
base58Prefixes[SCRIPT_ADDRESS] = std::vector<uint8_t>(1, 196); | base58Prefixes[SCRIPT_ADDRESS] = std::vector<uint8_t>(1, 196); | ||||
base58Prefixes[SECRET_KEY] = std::vector<uint8_t>(1, 239); | base58Prefixes[SECRET_KEY] = std::vector<uint8_t>(1, 239); | ||||
base58Prefixes[EXT_PUBLIC_KEY] = {0x04, 0x35, 0x87, 0xCF}; | base58Prefixes[EXT_PUBLIC_KEY] = {0x04, 0x35, 0x87, 0xCF}; | ||||
base58Prefixes[EXT_SECRET_KEY] = {0x04, 0x35, 0x83, 0x94}; | base58Prefixes[EXT_SECRET_KEY] = {0x04, 0x35, 0x83, 0x94}; | ||||
cashaddrPrefix = | cashaddrPrefix = | ||||
gArgs.GetBoolArg("-ecash", false) ? "ectest" : "bchtest"; | gArgs.GetBoolArg("-ecash", DEFAULT_ECASH) ? "ectest" : "bchtest"; | ||||
vFixedSeeds = std::vector<SeedSpec6>( | vFixedSeeds = std::vector<SeedSpec6>( | ||||
pnSeed6_test, pnSeed6_test + ARRAYLEN(pnSeed6_test)); | pnSeed6_test, pnSeed6_test + ARRAYLEN(pnSeed6_test)); | ||||
fDefaultConsistencyChecks = false; | fDefaultConsistencyChecks = false; | ||||
fRequireStandard = false; | fRequireStandard = false; | ||||
m_is_test_chain = true; | m_is_test_chain = true; | ||||
m_is_mockable_chain = false; | m_is_mockable_chain = false; | ||||
▲ Show 20 Lines • Show All 116 Lines • ▼ Show 20 Lines | CRegTestParams() { | ||||
chainTxData = ChainTxData{0, 0, 0}; | chainTxData = ChainTxData{0, 0, 0}; | ||||
base58Prefixes[PUBKEY_ADDRESS] = std::vector<uint8_t>(1, 111); | base58Prefixes[PUBKEY_ADDRESS] = std::vector<uint8_t>(1, 111); | ||||
base58Prefixes[SCRIPT_ADDRESS] = std::vector<uint8_t>(1, 196); | base58Prefixes[SCRIPT_ADDRESS] = std::vector<uint8_t>(1, 196); | ||||
base58Prefixes[SECRET_KEY] = std::vector<uint8_t>(1, 239); | base58Prefixes[SECRET_KEY] = std::vector<uint8_t>(1, 239); | ||||
base58Prefixes[EXT_PUBLIC_KEY] = {0x04, 0x35, 0x87, 0xCF}; | base58Prefixes[EXT_PUBLIC_KEY] = {0x04, 0x35, 0x87, 0xCF}; | ||||
base58Prefixes[EXT_SECRET_KEY] = {0x04, 0x35, 0x83, 0x94}; | base58Prefixes[EXT_SECRET_KEY] = {0x04, 0x35, 0x83, 0x94}; | ||||
cashaddrPrefix = | cashaddrPrefix = | ||||
gArgs.GetBoolArg("-ecash", false) ? "ecregtest" : "bchreg"; | gArgs.GetBoolArg("-ecash", DEFAULT_ECASH) ? "ecregtest" : "bchreg"; | ||||
} | } | ||||
}; | }; | ||||
static std::unique_ptr<CChainParams> globalChainParams; | static std::unique_ptr<CChainParams> globalChainParams; | ||||
const CChainParams &Params() { | const CChainParams &Params() { | ||||
assert(globalChainParams); | assert(globalChainParams); | ||||
return *globalChainParams; | return *globalChainParams; | ||||
Show All 23 Lines |