global: snapshot

This commit is contained in:
nym21
2026-02-21 17:40:34 +01:00
parent 2128aab6ca
commit be0d749f9c
13 changed files with 284 additions and 258 deletions
+1 -1
View File
@@ -207,6 +207,6 @@ where
} else if h + 1_u32 == starting_height {
Some(I::from(index_to_else.len()))
} else {
height_to_index.collect_one(starting_height.to_usize())
height_to_index.collect_one(starting_height)
}
}
+5 -5
View File
@@ -242,7 +242,7 @@ impl Stores {
vecs: &mut Vecs,
starting_indexes: &Indexes,
) -> Result<()> {
vecs.blocks.blockhash.for_each_range(
vecs.blocks.blockhash.for_each_range_at(
starting_indexes.height.to_usize(),
vecs.blocks.blockhash.len(),
|blockhash| {
@@ -272,7 +272,7 @@ impl Stores {
let start = starting_indexes.txindex.to_usize();
let end = vecs.transactions.txid.len();
let mut current_index = start;
vecs.transactions.txid.for_each_range(start, end, |txid| {
vecs.transactions.txid.for_each_range_at(start, end, |txid| {
let txindex = TxIndex::from(current_index);
let txidprefix = TxidPrefix::from(&txid);
@@ -303,7 +303,7 @@ impl Stores {
let rollback_end = vecs.outputs.outputtype.len();
let txindexes: Vec<TxIndex> =
vecs.outputs.txindex.collect_range(rollback_start, rollback_end);
vecs.outputs.txindex.collect_range_at(rollback_start, rollback_end);
for (i, txoutindex) in (rollback_start..rollback_end).enumerate() {
let outputtype = txoutindex_to_outputtype_reader.get(txoutindex);
@@ -332,8 +332,8 @@ impl Stores {
let start = starting_indexes.txinindex.to_usize();
let end = vecs.inputs.outpoint.len();
let outpoints: Vec<OutPoint> = vecs.inputs.outpoint.collect_range(start, end);
let spending_txindexes: Vec<TxIndex> = vecs.inputs.txindex.collect_range(start, end);
let outpoints: Vec<OutPoint> = vecs.inputs.outpoint.collect_range_at(start, end);
let spending_txindexes: Vec<TxIndex> = vecs.inputs.txindex.collect_range_at(start, end);
let outputs_to_unspend: Vec<_> = outpoints
.into_iter()
+1 -2
View File
@@ -250,8 +250,7 @@ impl AddressesVecs {
) -> Result<Box<dyn Iterator<Item = AddressHash> + '_>> {
macro_rules! make_iter {
($height_vec:expr, $bytes_vec:expr) => {{
let h = height.to_usize();
match $height_vec.collect_one(h) {
match $height_vec.collect_one(height) {
Some(mut index) => {
let reader = $bytes_vec.reader();
Ok(Box::new(std::iter::from_fn(move || {