diff --git a/src/amount.h b/src/amount.h --- a/src/amount.h +++ b/src/amount.h @@ -18,12 +18,12 @@ private: int64_t amount; - explicit constexpr Amount(int64_t _amount) : amount(_amount) {} - public: constexpr Amount() : amount(0) {} constexpr Amount(const Amount &_camount) : amount(_camount.amount) {} + explicit constexpr Amount(int64_t _amount) : amount(_amount) {} + static constexpr Amount zero() { return Amount(0); } static constexpr Amount satoshi() { return Amount(1); } @@ -157,7 +157,7 @@ * 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 Amount MAX_MONEY = 21000000 * COIN; +static constexpr Amount MAX_MONEY = 21000000 * COIN; inline bool MoneyRange(const Amount nValue) { return nValue >= Amount::zero() && nValue <= MAX_MONEY; }