Change `max_money` to a constant.

The value is statically known which is better expressed as a constant.
Also allows usage in const context.
This commit is contained in:
Martin Habovstiak 2022-11-22 21:08:40 +01:00
parent e16b9bdb20
commit e9dffb1b7b
1 changed files with 1 additions and 3 deletions

View File

@ -60,9 +60,7 @@ pub const MAX_SCRIPTNUM_VALUE: u32 = 0x80000000; // 2^31
/// The maximum value allowed in an output (useful for sanity checking,
/// since keeping everything below this value should prevent overflows
/// if you are doing anything remotely sane with monetary values).
pub fn max_money() -> u64 {
21_000_000 * COIN_VALUE
}
pub const MAX_MONEY: u64 = 21_000_000 * COIN_VALUE;
/// Constructs and returns the coinbase (and only) transaction of the Bitcoin genesis block
fn bitcoin_genesis_tx() -> Transaction {