Changeset View
Changeset View
Standalone View
Standalone View
src/amount.h
Show First 20 Lines • Show All 159 Lines • ▼ Show 20 Lines | struct Currency { | ||||
std::string ticker; | std::string ticker; | ||||
static const Currency &get(); | static const Currency &get(); | ||||
}; | }; | ||||
/** | /** | ||||
* No amount larger than this (in satoshi) is valid. | * No amount larger than this (in satoshi) is valid. | ||||
* | * | ||||
* Note that this constant is *not* the total money supply, which in Bitcoin | * Note that this constant is *not* the total money supply, which in eCash | ||||
* currently happens to be less than 21,000,000 BCH for various reasons, but | * currently happens to be less than 21,000,000 COIN for various reasons, | ||||
* rather a sanity check. As this sanity check is used by consensus-critical | * but rather a sanity check. As this sanity check is used by consensus-critical | ||||
* validation code, the exact value of the MAX_MONEY constant is consensus | * validation code, the exact value of the MAX_MONEY constant is consensus | ||||
* critical; in unusual circumstances like a(nother) overflow bug that allowed | * 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. | * for the creation of coins out of thin air modification could lead to a fork. | ||||
*/ | */ | ||||
static const Amount MAX_MONEY = 21000000 * COIN; | static const Amount MAX_MONEY = 21000000 * COIN; | ||||
inline bool MoneyRange(const Amount nValue) { | inline bool MoneyRange(const Amount nValue) { | ||||
return nValue >= Amount::zero() && nValue <= MAX_MONEY; | return nValue >= Amount::zero() && nValue <= MAX_MONEY; | ||||
} | } | ||||
#endif // BITCOIN_AMOUNT_H | #endif // BITCOIN_AMOUNT_H |