From e9dffb1b7b817f7d951b5e7861a6b7bc14d8a7ef Mon Sep 17 00:00:00 2001 From: Martin Habovstiak Date: Tue, 22 Nov 2022 21:08:40 +0100 Subject: [PATCH] Change `max_money` to a constant. The value is statically known which is better expressed as a constant. Also allows usage in const context. --- bitcoin/src/blockdata/constants.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/bitcoin/src/blockdata/constants.rs b/bitcoin/src/blockdata/constants.rs index ce5fc24c..8a9097dd 100644 --- a/bitcoin/src/blockdata/constants.rs +++ b/bitcoin/src/blockdata/constants.rs @@ -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 {