);
}
let rtx = self.database.begin_read()?;
let outpoint_to_value = rtx.open_table(OUTPOINT_TO_VALUE)?;
for outpoint in utxos.keys() {
if outpoint_to_value.get(&outpoint.store())?.is_none() {
return Err(anyhow!(
"output in Bitcoin Core wallet but not in ord index: {outpoint}"
));
}
}
Ok(utxos)
}
pub(crate) fn get_unspent_output_ranges(
&self,
wallet: Wallet,
) -> Result<Vec<(OutPoint, Vec<(u64, u64)>)>> {
self
.get_unspent_outputs(wallet)?
.into_keys()
.map(|outpoint| match self.list(outpoint)? {
Some(List::Unspent(sat_ranges)) => Ok((outpoint, sat_ranges)),
Some(List::Spent) => bail!("output {outpoint} in wallet but is spent according to index"),
None => bail!("index has not seen {outpoint}"),
})
.collect()
}
pub(crate) fn has_sat_index(&self) -> bool {
self.index_sats
}
pub(crate) fn info(&self) -> Result<Info> {
fn insert_table_info<K: RedbKey + 'static, V: RedbValue + 'static>(