Skip to content

Commit

Permalink
Update signer
Browse files Browse the repository at this point in the history
  • Loading branch information
sanket1729 committed Oct 1, 2020
1 parent 3dd2905 commit aba41d0
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/miniscript/satisfy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ use bitcoin::hashes::{hash160, ripemd160, sha256, sha256d};
use bitcoin::{self, secp256k1};
use {MiniscriptKey, ToPublicKey};

use miniscript::types::extra_props::HEIGHT_TIME_THRESHOLD;
use ScriptContext;
use Terminal;

Expand Down Expand Up @@ -94,7 +95,12 @@ pub struct Older(pub u32);

impl<Pk: MiniscriptKey> Satisfier<Pk> for Older {
fn check_older(&self, n: u32) -> bool {
n <= self.0
// if n > self.0; we will be returning false anyways
if n < HEIGHT_TIME_THRESHOLD && self.0 >= HEIGHT_TIME_THRESHOLD {
false
} else {
n <= self.0
}
}
}

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

impl<Pk: MiniscriptKey> Satisfier<Pk> for After {
fn check_after(&self, n: u32) -> bool {
n <= self.0
// if n > self.0; we will be returning false anyways
if n < HEIGHT_TIME_THRESHOLD && self.0 >= HEIGHT_TIME_THRESHOLD {
false
} else {
n <= self.0
}
}
}

Expand Down

0 comments on commit aba41d0

Please sign in to comment.