Skip to content

Commit

Permalink
Merge #740: fix: zero sequence check on relative time
Browse files Browse the repository at this point in the history
c128e79 fix: zero sequence check on relative time (Chris Hyunhum Cho)

Pull request description:

  I've just found out RelLockTime misses zero sequence check, which must be disallowed for miniscript.

ACKs for top commit:
  apoelstra:
    ACK c128e79 successfully ran local tests

Tree-SHA512: 9ccc96d67672c2077ec20efeda105e9941a1318030ac63b46e3260b886605d8a7231176413b4dccb6f1542008890f7df977bf4ed445f0fa9550cfa8f8dfaa0e7
  • Loading branch information
apoelstra committed Sep 3, 2024
2 parents 1a3605d + c128e79 commit 734d34e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/primitives/relative_locktime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ impl RelLockTime {
impl convert::TryFrom<Sequence> for RelLockTime {
type Error = RelLockTimeError;
fn try_from(seq: Sequence) -> Result<Self, RelLockTimeError> {
if seq.is_relative_lock_time() {
if seq.is_relative_lock_time() && seq != Sequence::ZERO {
Ok(RelLockTime(seq))
} else {
Err(RelLockTimeError { value: seq.to_consensus_u32() })
Expand Down

0 comments on commit 734d34e

Please sign in to comment.