consensus/consensus.h contains a number of static const
values relating to consensus rules.
These are globally shared between files such as validation.cpp, rpc_mining.cpp and rpc/mining.cpp.
These consensus-critical values are marked as const
so that there is no possibility that they can be changed at any point during program execution.
One example of this would be the maximum block weight which should not ever be exceeded:
static const unsigned int MAX_BLOCK_WEIGHT = 4000000;
consensus/amount.h contains the conversion rate between satoshis and one "bitcoin", as well as a MAX_MONEY
constant.
These are marked as constexpr
to indicate that they should be evaluated at compile time and then remain as const
during execution.
/** The amount of satoshis in one BTC. */
static constexpr CAmount COIN = 100000000;
/** No amount larger than this (in satoshi) is valid.
*
* Note that this constant is *not* the total money supply, which in Bitcoin
* currently happens to be less than 21,000,000 BTC for various reasons, but
* rather a sanity check. As this sanity check is used by consensus-critical
* validation code, the exact value of the MAX_MONEY constant is consensus
* critical; in unusual circumstances like a(nother) overflow bug that allowed
* for the creation of coins out of thin air modification could lead to a fork.
* */
static constexpr CAmount MAX_MONEY = 21000000 * COIN;
Tip
|
Do you think that the |