Skip to content

Commit d030b8f

Browse files
committed
feat: add from_height_unchecked
1 parent 02a92d8 commit d030b8f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/primitives/relative_locktime.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ impl RelLockTime {
5252
convert::TryFrom::try_from(Sequence::from_height(height))
5353
}
5454

55+
/// Takes a 16-bit number of blocks and produces a relative locktime from it.
56+
pub fn from_height_unchecked(height: u16) -> Self { RelLockTime(Sequence::from_height(height)) }
57+
5558
/// Takes a 16-bit number of 512-second time intervals and produces a relative locktime from it.
5659
pub fn from_512_second_intervals(time: u16) -> Self {
5760
RelLockTime(Sequence::from_512_second_intervals(time))

0 commit comments

Comments
 (0)