mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-23 15:20:49 +01:00
This is a follow-up to previous commits moving the chain constants out of chainparamsbase. The script removes the chainparamsbase header in all files where it is included, but not used. This is done by filtering against all defined symbols of the header as well as its respective .cpp file. The kernel chainparams now no longer relies on chainparamsbase. -BEGIN VERIFY SCRIPT- sed -i '/#include <chainparamsbase.h>/d' $( git grep -l 'chainparamsbase.h' | xargs grep -L 'CBaseChainParams\|CreateBaseChainParams\|SetupChainParamsBaseOptions\|BaseParams\|SelectBaseParams\|chainparamsbase.cpp' ) -END VERIFY SCRIPT-
45 lines
1.3 KiB
C++
45 lines
1.3 KiB
C++
// Copyright (c) 2009-2010 Satoshi Nakamoto
|
|
// Copyright (c) 2009-2021 The Bitcoin Core developers
|
|
// Distributed under the MIT software license, see the accompanying
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
#ifndef BITCOIN_CHAINPARAMS_H
|
|
#define BITCOIN_CHAINPARAMS_H
|
|
|
|
#include <kernel/chainparams.h>
|
|
|
|
#include <consensus/params.h>
|
|
#include <netaddress.h>
|
|
#include <primitives/block.h>
|
|
#include <protocol.h>
|
|
#include <util/chaintype.h>
|
|
#include <util/hash_type.h>
|
|
|
|
#include <cstdint>
|
|
#include <memory>
|
|
#include <string>
|
|
#include <unordered_map>
|
|
#include <vector>
|
|
|
|
class ArgsManager;
|
|
|
|
/**
|
|
* Creates and returns a std::unique_ptr<CChainParams> of the chosen chain.
|
|
* @returns a CChainParams* of the chosen chain.
|
|
* @throws a std::runtime_error if the chain is not supported.
|
|
*/
|
|
std::unique_ptr<const CChainParams> CreateChainParams(const ArgsManager& args, const ChainType chain);
|
|
|
|
/**
|
|
* Return the currently selected parameters. This won't change after app
|
|
* startup, except for unit tests.
|
|
*/
|
|
const CChainParams &Params();
|
|
|
|
/**
|
|
* Sets the params returned by Params() to those for the given chain name.
|
|
* @throws std::runtime_error when the chain is not supported.
|
|
*/
|
|
void SelectParams(const ChainType chain);
|
|
|
|
#endif // BITCOIN_CHAINPARAMS_H
|