From 4adc1e8f185f9b4a27d5fc68017302dc675d0074 Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Sun, 20 Feb 2022 17:58:02 -0800 Subject: [PATCH] Improve find height check --- src/index.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/index.rs b/src/index.rs index c0c3699a5c..20f877e4e4 100644 --- a/src/index.rs +++ b/src/index.rs @@ -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) {