Skip to content

Commit

Permalink
Update signer
Browse files Browse the repository at this point in the history
  • Loading branch information
sanket1729 committed Aug 28, 2020
1 parent 50b06d7 commit ca46d42
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 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,13 @@ pub struct Older(pub u32);

impl<Pk: MiniscriptKey> Satisfier<Pk> for Older {
fn check_older(&self, n: u32) -> bool {
n <= self.0
if !((n < HEIGHT_TIME_THRESHOLD && self.0 < HEIGHT_TIME_THRESHOLD)
&& (n >= HEIGHT_TIME_THRESHOLD && self.0 >= HEIGHT_TIME_THRESHOLD))
{
false
} else {
n <= self.0
}
}
}

Expand All @@ -104,7 +111,13 @@ pub struct After(pub u32);

impl<Pk: MiniscriptKey> Satisfier<Pk> for After {
fn check_after(&self, n: u32) -> bool {
n <= self.0
if !((n < HEIGHT_TIME_THRESHOLD && self.0 < HEIGHT_TIME_THRESHOLD)
&& (n >= HEIGHT_TIME_THRESHOLD && self.0 >= HEIGHT_TIME_THRESHOLD))
{
false
} else {
n <= self.0
}
}
}

Expand Down

0 comments on commit ca46d42

Please sign in to comment.