}
let info = {
let statistic_to_count = wtx.open_table(STATISTIC_TO_COUNT)?;
let sat_ranges = statistic_to_count
.get(&Statistic::SatRanges.key())?
.map(|x| x.value())
.unwrap_or(0);
let outputs_traversed = statistic_to_count
.get(&Statistic::OutputsTraversed.key())?
.map(|x| x.value())
.unwrap_or(0);
Info {
index_path: self.path.clone(),
blocks_indexed: wtx
.open_table(HEIGHT_TO_BLOCK_HASH)?
.range(0..)?
.next_back()
.and_then(|result| result.ok())
.map(|(height, _hash)| height.value() + 1)
.unwrap_or(0),
branch_pages: stats.branch_pages(),
fragmented_bytes: stats.fragmented_bytes(),
index_file_size: fs::metadata(&self.path)?.len(),
leaf_pages: stats.leaf_pages(),
metadata_bytes: stats.metadata_bytes(),
sat_ranges,
outputs_traversed,
page_size: stats.page_size(),
stored_bytes: stats.stored_bytes(),