Skip to content

Commit

Permalink
reverse reorg indexing order
Browse files Browse the repository at this point in the history
  • Loading branch information
mononaut committed Dec 27, 2024
1 parent efed713 commit a454994
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/new_index/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,12 +294,12 @@ impl Indexer {
// This channel holds a Vec of [u8; 32] scripts found in the blocks (with duplicates)
// if we reorg the whole mainnet chain it should come out to about 145 GB of memory.
let (tx, rx) = crossbeam_channel::unbounded();
// Delete txstore
bitcoind_sequential_fetcher(daemon, reorged.clone())?
.map(|blocks| self.add(&blocks, Operation::DeleteBlocks));
// Delete history_db
bitcoind_sequential_fetcher(daemon, reorged)?
bitcoind_sequential_fetcher(daemon, reorged.clone())?
.map(|blocks| self.index(&blocks, Operation::DeleteBlocksWithHistory(tx.clone())));
// Delete txstore
bitcoind_sequential_fetcher(daemon, reorged)?
.map(|blocks| self.add(&blocks, Operation::DeleteBlocks));
// All senders must be dropped for receiver iterator to finish
drop(tx);

Expand Down

0 comments on commit a454994

Please sign in to comment.