Bitcoin Core  27.99.0
P2P Digital Currency
Typedefs | Functions | Variables
amount.h File Reference
#include <cstdint>
Include dependency graph for amount.h:

Go to the source code of this file.

Typedefs

typedef int64_t CAmount
 Amount in satoshis (Can be negative) More...
 

Functions

bool MoneyRange (const CAmount &nValue)
 

Variables

static constexpr CAmount COIN = 100000000
 The amount of satoshis in one BTC. More...
 
static constexpr CAmount MAX_MONEY = 21000000 * COIN
 No amount larger than this (in satoshi) is valid. More...
 

Typedef Documentation

◆ CAmount

typedef int64_t CAmount

Amount in satoshis (Can be negative)

Definition at line 12 of file amount.h.

Function Documentation

◆ MoneyRange()

bool MoneyRange ( const CAmount nValue)
inline

Definition at line 27 of file amount.h.

Here is the caller graph for this function:

Variable Documentation

◆ COIN

constexpr CAmount COIN = 100000000
staticconstexpr

The amount of satoshis in one BTC.

Definition at line 15 of file amount.h.

◆ MAX_MONEY

constexpr CAmount MAX_MONEY = 21000000 * COIN
staticconstexpr

No amount larger than this (in satoshi) is valid.

Note that this constant is not the total money supply, which in Bitcoin currently happens to be less than 21,000,000 BTC for various reasons, 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 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.

Definition at line 26 of file amount.h.