Simplify replay_blockstore_into_bank() (#23282)

This commit is contained in:
Brooks Prumo 2022-02-25 06:57:04 -06:00 committed by GitHub
parent ff04a5b989
commit 533eca3b4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 9 deletions

View File

@ -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,
@ -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)
}