self.outputs_inserted_since_flush,
);
let mut outpoint_to_sat_ranges = wtx.open_table(OUTPOINT_TO_SAT_RANGES)?;
for (outpoint, sat_range) in self.range_cache.drain() {
outpoint_to_sat_ranges.insert(&outpoint, sat_range.as_slice())?;
}
self.outputs_inserted_since_flush = 0;
}
{
let mut outpoint_to_value = wtx.open_table(OUTPOINT_TO_VALUE)?;
for (outpoint, value) in value_cache {
outpoint_to_value.insert(&outpoint.store(), &value)?;
}
}
Index::increment_statistic(&wtx, Statistic::OutputsTraversed, self.outputs_traversed)?;
self.outputs_traversed = 0;
Index::increment_statistic(&wtx, Statistic::SatRanges, self.sat_ranges_since_flush)?;
self.sat_ranges_since_flush = 0;
Index::increment_statistic(&wtx, Statistic::Commits, 1)?;
wtx.commit()?;
Reorg::update_savepoints(self.index, self.height)?;
Ok(())
}
}