From 861d97de368c6cdb53dbd95373df2e88596685df Mon Sep 17 00:00:00 2001 From: ChrisCho-H Date: Thu, 3 Oct 2024 22:51:49 +0900 Subject: [PATCH 1/2] feat: add FINAL constant to disable all --- primitives/src/sequence.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/primitives/src/sequence.rs b/primitives/src/sequence.rs index 2d8a84760..8f864db68 100644 --- a/primitives/src/sequence.rs +++ b/primitives/src/sequence.rs @@ -38,12 +38,14 @@ pub struct Sequence(pub u32); impl Sequence { /// The maximum allowable sequence number. /// - /// This sequence number disables absolute lock time and replace-by-fee. + /// The sequence number that disables replace-by-fee, absolute lock time and relative lock time. pub const MAX: Self = Sequence(0xFFFFFFFF); /// Zero value sequence. /// /// This sequence number enables replace-by-fee and absolute lock time. pub const ZERO: Self = Sequence(0); + /// The sequence number that disables replace-by-fee, absolute lock time and relative lock time. + pub const FINAL: Self = Sequence::MAX; /// The sequence number that enables absolute lock time but disables replace-by-fee /// and relative lock time. pub const ENABLE_LOCKTIME_NO_RBF: Self = Sequence::MIN_NO_RBF; From 4499b5c95b19fdbb895bd57ee709697a9b6c8762 Mon Sep 17 00:00:00 2001 From: ChrisCho-H Date: Sat, 5 Oct 2024 18:39:26 +0900 Subject: [PATCH 2/2] feat: rename ENABLE_RBF_NO_LOCKTIME to ENABLE_LOCKTIME_AND_RBF --- primitives/src/sequence.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/primitives/src/sequence.rs b/primitives/src/sequence.rs index 8f864db68..dff59327c 100644 --- a/primitives/src/sequence.rs +++ b/primitives/src/sequence.rs @@ -51,7 +51,16 @@ impl Sequence { pub const ENABLE_LOCKTIME_NO_RBF: Self = Sequence::MIN_NO_RBF; /// The sequence number that enables replace-by-fee and absolute lock time but /// disables relative lock time. + #[deprecated( + since = "TBD", + note = "This constant has ambiguous name. Please use ENABLE_LOCKTIME_AND_RBF instead." + )] pub const ENABLE_RBF_NO_LOCKTIME: Self = Sequence(0xFFFFFFFD); + /// The maximum sequence number that enables replace-by-fee and absolute lock time but + /// disables relative lock time. + /// + /// This sequence number has no meaning other than to enable RBF and the absolute locktime. + pub const ENABLE_LOCKTIME_AND_RBF: Self = Sequence(0xFFFFFFFD); /// The number of bytes that a sequence number contributes to the size of a transaction. pub const SIZE: usize = 4; // Serialized length of a u32.