Skip to content

Commit a662105

Browse files
committed
Update signer
1 parent d0a4f1a commit a662105

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

src/miniscript/satisfy.rs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ use bitcoin::hashes::{hash160, ripemd160, sha256, sha256d};
2525
use bitcoin::{self, secp256k1};
2626
use {MiniscriptKey, ToPublicKey};
2727

28+
use miniscript::types::extra_props::HEIGHT_TIME_THRESHOLD;
2829
use ScriptContext;
2930
use Terminal;
3031

@@ -94,7 +95,12 @@ pub struct Older(pub u32);
9495

9596
impl<Pk: MiniscriptKey> Satisfier<Pk> for Older {
9697
fn check_older(&self, n: u32) -> bool {
97-
n <= self.0
98+
// if n > self.0; we will be returning false anyways
99+
if n < HEIGHT_TIME_THRESHOLD && self.0 >= HEIGHT_TIME_THRESHOLD {
100+
false
101+
} else {
102+
n <= self.0
103+
}
98104
}
99105
}
100106

@@ -104,7 +110,12 @@ pub struct After(pub u32);
104110

105111
impl<Pk: MiniscriptKey> Satisfier<Pk> for After {
106112
fn check_after(&self, n: u32) -> bool {
107-
n <= self.0
113+
// if n > self.0; we will be returning false anyways
114+
if n < HEIGHT_TIME_THRESHOLD && self.0 >= HEIGHT_TIME_THRESHOLD {
115+
false
116+
} else {
117+
n <= self.0
118+
}
108119
}
109120
}
110121

0 commit comments

Comments
 (0)