From 863e52fe63a67fa020fb1ef527b9095a35ab77a5 Mon Sep 17 00:00:00 2001 From: fanquake Date: Sat, 11 Sep 2021 11:41:46 +0800 Subject: consensus: make COIN & MAX_MONEY constexpr --- src/consensus/amount.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/consensus') 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 -- cgit v1.2.3