Skip to content

Commit

Permalink
Simplify replay_blockstore_into_bank() (#23282)
Browse files Browse the repository at this point in the history
  • Loading branch information
brooksprumo authored Feb 25, 2022
1 parent ff04a5b commit 533eca3
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions core/src/replay_stage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1613,7 +1613,10 @@ impl ReplayStage {
verify_recyclers: &VerifyRecyclers,
) -> result::Result<usize, BlockstoreProcessorError> {
let tx_count_before = bank_progress.replay_progress.num_txs;
let confirm_result = blockstore_processor::confirm_slot(
// All errors must lead to marking the slot as dead, otherwise,
// the `check_slot_agrees_with_cluster()` called by `replay_active_banks()`
// will break!
blockstore_processor::confirm_slot(
blockstore,
bank,
&mut bank_progress.replay_stats,
Expand All @@ -1625,16 +1628,9 @@ impl ReplayStage {
None,
verify_recyclers,
false,
);
)?;
let tx_count_after = bank_progress.replay_progress.num_txs;
let tx_count = tx_count_after - tx_count_before;
confirm_result.map_err(|err| {
// All errors must lead to marking the slot as dead, otherwise,
// the `check_slot_agrees_with_cluster()` called by `replay_active_banks()`
// will break!
err
})?;

Ok(tx_count)
}

Expand Down

0 comments on commit 533eca3

Please sign in to comment.