if start <= sat && sat < end { return Ok(Some(SatPoint { outpoint: Entry::load(*key.value()), offset: offset + sat - start, })); } offset += end - start; } } Ok(None) } pub(crate) fn find_range( &self, range_start: u64, range_end: u64, ) -> Result>> { let rtx = self.begin_read()?; if rtx.block_count()? < Sat(range_end - 1).height().n() + 1 { return Ok(None); } let Some(mut remaining_sats) = range_end.checked_sub(range_start) else { return Err(anyhow!("range end is before range start")); }; let outpoint_to_sat_ranges = rtx.0.open_table(OUTPOINT_TO_SAT_RANGES)?; let mut result = Vec::new(); for range in outpoint_to_sat_ranges.range::<&[u8; 36]>(&[0; 36]..)? { let (outpoint_entry, sat_ranges_entry) = range?; let mut offset = 0; for sat_range in sat_ranges_entry.value().chunks_exact(11) { let (start, end) = SatRange::load(sat_range.try_into().unwrap());