Merge rust-bitcoin/rust-bitcoin#1679: Add constant for coinbase maturity

7d1645aea0 Add constant for coinbase maturity (benthecarman)

Pull request description:

  Not sure if this is the best place to put this but it is nice to have a constant for this instead of having other libraries make their own (ie https://github.com/lightningdevkit/rust-lightning/pull/1924#pullrequestreview-1222807626)

ACKs for top commit:
  tcharding:
    ACK 7d1645aea0
  apoelstra:
    ACK 7d1645aea0

Tree-SHA512: 5ac2a3359cadd303158c66ba45db8f4bf8cc80b6c19604262999ff361fd0bd98e2a4851c57da1962cb5c74f5789a85c8b3861f1742706a60ce1fbc57c3c200cc
This commit is contained in:
Andrew Poelstra 2023-02-28 21:51:13 +00:00
commit 5ad2bec626
No known key found for this signature in database
GPG Key ID: C588D63CE41B97C1
1 changed files with 2 additions and 0 deletions

View File

@ -54,6 +54,8 @@ pub const MAX_SCRIPT_ELEMENT_SIZE: usize = 520;
pub const SUBSIDY_HALVING_INTERVAL: u32 = 210_000; pub const SUBSIDY_HALVING_INTERVAL: u32 = 210_000;
/// Maximum allowed value for an integer in Script. /// Maximum allowed value for an integer in Script.
pub const MAX_SCRIPTNUM_VALUE: u32 = 0x80000000; // 2^31 pub const MAX_SCRIPTNUM_VALUE: u32 = 0x80000000; // 2^31
/// Number of blocks needed for an output from a coinbase transaction to be spendable.
pub const COINBASE_MATURITY: u32 = 100;
/// The maximum value allowed in an output (useful for sanity checking, /// The maximum value allowed in an output (useful for sanity checking,
/// since keeping everything below this value should prevent overflows /// since keeping everything below this value should prevent overflows