Add blockdata::constants::max_money

This commit is contained in:
Andrew Poelstra 2014-08-22 20:29:16 -07:00
parent e3445ebef7
commit 18a61dd560
1 changed files with 8 additions and 1 deletions

View File

@ -32,7 +32,7 @@ use util::hash::MerkleRoot;
use util::uint::Uint256;
pub static MAX_SEQUENCE: u32 = 0xFFFFFFFF;
pub static COIN_VALUE: u64 = 100000000;
pub static COIN_VALUE: u64 = 100_000_000;
pub static TARGET_BLOCK_SPACING: u32 = 600;
pub static DIFFCHANGE_INTERVAL: u32 = 2016;
pub static DIFFCHANGE_TIMESPAN: u32 = 14 * 24 * 3600;
@ -42,6 +42,13 @@ pub fn max_target(_: Network) -> Uint256 {
from_u64::<Uint256>(0xFFFF).unwrap() << 208u
}
/// 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(_: Network) -> u64 {
21_000_000 * COIN_VALUE
}
/// Constructs and returns the coinbase (and only) transaction of the Bitcoin genesis block
fn bitcoin_genesis_tx() -> Transaction {
// Base