diff options
author | fanquake <fanquake@gmail.com> | 2021-09-11 11:41:46 +0800 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2021-09-30 07:42:00 +0800 |
commit | 863e52fe63a67fa020fb1ef527b9095a35ab77a5 (patch) | |
tree | a3fa55315fcbd5c3487d8d24b895bb7c8d67a75f /src/consensus | |
parent | d09071da5bc997f2de1f55ca7a9babc3d7619329 (diff) |
consensus: make COIN & MAX_MONEY constexpr
Diffstat (limited to 'src/consensus')
-rw-r--r-- | src/consensus/amount.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/consensus/amount.h b/src/consensus/amount.h index d032e7b908..b01615ac65 100644 --- a/src/consensus/amount.h +++ b/src/consensus/amount.h @@ -11,7 +11,7 @@ /** Amount in satoshis (Can be negative) */ typedef int64_t CAmount; -static const CAmount COIN = 100000000; +static constexpr CAmount COIN = 100000000; /** No amount larger than this (in satoshi) is valid. * @@ -22,7 +22,7 @@ static const CAmount COIN = 100000000; * 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 const CAmount MAX_MONEY = 21000000 * COIN; +static constexpr CAmount MAX_MONEY = 21000000 * COIN; inline bool MoneyRange(const CAmount& nValue) { return (nValue >= 0 && nValue <= MAX_MONEY); } #endif // BITCOIN_CONSENSUS_AMOUNT_H |