Skip to content

Commit 863e52f

Browse files
committed
consensus: make COIN & MAX_MONEY constexpr
1 parent d09071d commit 863e52f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/consensus/amount.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
/** Amount in satoshis (Can be negative) */
1212
typedef int64_t CAmount;
1313

14-
static const CAmount COIN = 100000000;
14+
static constexpr CAmount COIN = 100000000;
1515

1616
/** No amount larger than this (in satoshi) is valid.
1717
*
@@ -22,7 +22,7 @@ static const CAmount COIN = 100000000;
2222
* critical; in unusual circumstances like a(nother) overflow bug that allowed
2323
* for the creation of coins out of thin air modification could lead to a fork.
2424
* */
25-
static const CAmount MAX_MONEY = 21000000 * COIN;
25+
static constexpr CAmount MAX_MONEY = 21000000 * COIN;
2626
inline bool MoneyRange(const CAmount& nValue) { return (nValue >= 0 && nValue <= MAX_MONEY); }
2727

2828
#endif // BITCOIN_CONSENSUS_AMOUNT_H

0 commit comments

Comments
 (0)