Skip to content

Commit

Permalink
feat: add from_height_unchecked
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisCho-H committed Sep 15, 2024
1 parent 02a92d8 commit d030b8f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/primitives/relative_locktime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ impl RelLockTime {
convert::TryFrom::try_from(Sequence::from_height(height))
}

/// Takes a 16-bit number of blocks and produces a relative locktime from it.
pub fn from_height_unchecked(height: u16) -> Self { RelLockTime(Sequence::from_height(height)) }

/// Takes a 16-bit number of 512-second time intervals and produces a relative locktime from it.
pub fn from_512_second_intervals(time: u16) -> Self {
RelLockTime(Sequence::from_512_second_intervals(time))
Expand Down

0 comments on commit d030b8f

Please sign in to comment.