From 2e3006a729409d6e0006853e54e4647eb2eb460f Mon Sep 17 00:00:00 2001 From: yancy Date: Tue, 1 Aug 2023 08:48:25 +0200 Subject: [PATCH] Add max standard tx weight constant to transaction --- bitcoin/src/blockdata/transaction.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bitcoin/src/blockdata/transaction.rs b/bitcoin/src/blockdata/transaction.rs index edd0c223..43eb2f2e 100644 --- a/bitcoin/src/blockdata/transaction.rs +++ b/bitcoin/src/blockdata/transaction.rs @@ -678,6 +678,10 @@ impl cmp::Ord for Transaction { } impl Transaction { + /// Maximum transaction weight for Bitcoin Core 25.0. + // https://github.com/bitcoin/bitcoin/blob/44b05bf3fef2468783dcebf651654fdd30717e7e/src/policy/policy.h#L27 + pub const MAX_STANDARD_WEIGHT: Weight = Weight::from_wu(400_000); + /// Computes a "normalized TXID" which does not include any signatures. /// /// This gives a way to identify a transaction that is "the same" as