Skip to content

Commit

Permalink
fix(snapshot): block increment for Transactions segment (#6274)
Browse files Browse the repository at this point in the history
  • Loading branch information
shekhirin authored Jan 29, 2024
1 parent 17d94cf commit 674c8e0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion crates/snapshot/src/segments/transactions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ impl<DB: Database> Segment<DB> for Transactions {
snapshot_provider.get_writer(*block_range.start(), SnapshotSegment::Transactions)?;

for block in block_range {
if block > 0 {
let _snapshot_block =
snapshot_writer.increment_block(SnapshotSegment::Transactions)?;
debug_assert_eq!(_snapshot_block, block);
}

let block_body_indices = provider
.block_body_indices(block)?
.ok_or(ProviderError::BlockBodyIndicesNotFound(block))?;
Expand All @@ -48,7 +54,6 @@ impl<DB: Database> Segment<DB> for Transactions {

snapshot_writer.append_transaction(tx_number, transaction)?;
}
snapshot_writer.increment_block(SnapshotSegment::Transactions)?;
}

Ok(())
Expand Down

0 comments on commit 674c8e0

Please sign in to comment.