mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-09 05:14:22 +01:00
consensus: make COIN & MAX_MONEY constexpr
This commit is contained in:
parent
d09071da5b
commit
863e52fe63
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue