Skip to content

Commit

Permalink
Improve find height check (#150)
Browse files Browse the repository at this point in the history
  • Loading branch information
casey authored Feb 21, 2022
1 parent a5c26bc commit 8c6f5d7
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,10 +270,9 @@ impl Index {
Err(err) => return Err(err.into()),
};

if let Some((height, _hash)) = height_to_hash.range_reversed(0..)?.next() {
if height < ordinal.height().0 {
return Ok(None);
}
match height_to_hash.range_reversed(0..)?.next() {
Some((height, _hash)) if height >= ordinal.height().0 => {}
_ => return Ok(None),
}

let key_to_satpoint = match rtx.open_table(&Self::KEY_TO_SATPOINT) {
Expand Down

0 comments on commit 8c6f5d7

Please sign in to comment.