Bitcoin ABC 0.26.3
P2P Digital Currency
Loading...
Searching...
No Matches
config.cpp
Go to the documentation of this file.
1// Copyright (c) 2017-2019 The Bitcoin developers
2// Distributed under the MIT software license, see the accompanying
3// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
5#include <config.h>
6
7#include <consensus/consensus.h> // DEFAULT_MAX_BLOCK_SIZE
8
10 : useCashAddr(false), nMaxBlockSize(DEFAULT_MAX_BLOCK_SIZE) {}
11
13 // Do not allow maxBlockSize to be set below historic 1MB limit
14 // It cannot be equal either because of the "must be big" UAHF rule.
16 return false;
17 }
18
20 return true;
21}
22
26
30
32 if (chainParams) {
33 return *chainParams;
34 }
35 return Params();
36}
37
39
40const Config &GetConfig() {
41 return gConfig;
42}
43
48 return useCashAddr;
49}
const CChainParams & Params()
Return the currently selected parameters.
CChainParams defines various tweakable parameters of a given instance of the Bitcoin system.
Definition chainparams.h:80
bool UseCashAddrEncoding() const override
Definition config.cpp:47
bool useCashAddr
Definition config.h:44
bool SetMaxBlockSize(uint64_t maxBlockSize) override
Definition config.cpp:12
void SetChainParams(const CChainParams chainParamsIn) override
Definition config.cpp:27
uint64_t nMaxBlockSize
The largest block size this node will accept.
Definition config.h:47
std::optional< const CChainParams > chainParams
Definition config.h:49
const CChainParams & GetChainParams() const override
Definition config.cpp:31
void SetCashAddrEncoding(bool) override
Definition config.cpp:44
uint64_t GetMaxBlockSize() const override
Definition config.cpp:23
const Config & GetConfig()
Definition config.cpp:40
static GlobalConfig gConfig
Definition config.cpp:38
static const uint64_t LEGACY_MAX_BLOCK_SIZE
The maximum allowed size for a block, before the UAHF.
Definition consensus.h:18
static const uint64_t DEFAULT_MAX_BLOCK_SIZE
Default setting for maximum allowed size for a block, in bytes.
Definition consensus.h:20
T GetRand(T nMax=std::numeric_limits< T >::max()) noexcept
Generate a uniform random integer of type T in the range [0..nMax) nMax defaults to std::numeric_limi...
Definition random.h:85