Merge rust-bitcoin/rust-bitcoin#3276: fix: deprecate wrong and unused max script num

345d3daa72 fix: deprecate wrong and unused max script num (ChrisCho-H)

Pull request description:

  ~~Script number can be up to 2^39 - 1 to encode locktime.~~
  ~~If it's only for the integer operation besides locktime, it must be 2^31 - 1, not 2^31.~~

  I agree with apoelstra  opinion to deprecate this value.

ACKs for top commit:
  apoelstra:
    ACK 345d3daa72 successfully ran local tests
  Kixunil:
    ACK 345d3daa72

Tree-SHA512: df4205415634d8db1412f16a75d1dbc110ed69930cefa085bdaa268a7fcaf47776dd1d8ed6965e6bbb476825b5f80e5c00bb375730ad102bae8868abe5894068
This commit is contained in:
merge-script 2024-09-02 00:01:32 +00:00
commit 6a06c023e0
No known key found for this signature in database
GPG Key ID: C588D63CE41B97C1
1 changed files with 1 additions and 0 deletions

View File

@ -47,6 +47,7 @@ pub const MAX_STACK_ELEMENT_SIZE: usize = 520;
/// How may blocks between halvings.
pub const SUBSIDY_HALVING_INTERVAL: u32 = 210_000;
/// Maximum allowed value for an integer in Script.
#[deprecated(since = "TBD", note = "This constant has ambiguous semantics. Please carefully check your intended use-case and define a new constant reflecting that.")]
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;