diff --git a/bitcoin/src/blockdata/locktime/relative.rs b/bitcoin/src/blockdata/locktime/relative.rs index b4aa6a6f..dbad4d31 100644 --- a/bitcoin/src/blockdata/locktime/relative.rs +++ b/bitcoin/src/blockdata/locktime/relative.rs @@ -6,7 +6,7 @@ //! whether bit 22 of the `u32` consensus value is set. //! -use core::fmt; +use core::{cmp, fmt}; #[cfg(all(test, mutate))] use mutagen::mutate; @@ -20,8 +20,13 @@ pub use units::locktime::relative::{Height, Time, TimeOverflowError}; /// A relative lock time value, representing either a block height or time (512 second intervals). /// -/// The `relative::LockTime` type does not have any constructors, this is by design, please use -/// `Sequence::to_relative_lock_time` to create a relative lock time. +/// Used for sequence numbers (`nSequence` in Bitcoin Core and [`crate::Transaction::TxIn::sequence`] +/// in this library) and also for the argument to opcode 'OP_CHECKSEQUENCEVERIFY`. +/// +/// ### Note on ordering +/// +/// Because locktimes may be height- or time-based, and these metrics are incommensurate, there +/// is no total ordering on locktimes. We therefore have implemented [`PartialOrd`] but not [`Ord`]. /// /// ### Relevant BIPs /// @@ -173,6 +178,19 @@ impl From