From cf5048faaaaa3654a10c6001cde7b56aff37f41d Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Sat, 5 Mar 2022 15:48:06 +0100 Subject: [PATCH] Eliminate to_loadresult() --- ledger/src/bank_forks_utils.rs | 49 ++++++++++++++-------------------- 1 file changed, 20 insertions(+), 29 deletions(-) diff --git a/ledger/src/bank_forks_utils.rs b/ledger/src/bank_forks_utils.rs index e4c9bb8b4..2a0575707 100644 --- a/ledger/src/bank_forks_utils.rs +++ b/ledger/src/bank_forks_utils.rs @@ -2,7 +2,7 @@ use { crate::{ blockstore::Blockstore, blockstore_processor::{ - self, BlockstoreProcessorError, BlockstoreProcessorResult, CacheBlockMetaSender, + self, BlockstoreProcessorError, CacheBlockMetaSender, ProcessOptions, TransactionStatusSender, }, leader_schedule_cache::LeaderScheduleCache, @@ -31,22 +31,6 @@ pub type LoadResult = result::Result< BlockstoreProcessorError, >; -fn to_loadresult( - bpr: BlockstoreProcessorResult, - starting_snapshot_hashes: Option, -) -> LoadResult { - bpr.map( - |(bank_forks, leader_schedule_cache, last_full_snapshot_slot)| { - ( - bank_forks, - leader_schedule_cache, - last_full_snapshot_slot, - starting_snapshot_hashes, - ) - }, - ) -} - /// Load the banks and accounts /// /// If a snapshot config is given, and a snapshot is found, it will be loaded. Otherwise, load @@ -123,18 +107,25 @@ pub fn load( ) }; - to_loadresult( - blockstore_processor::process_blockstore_from_root( - blockstore, - bank_forks, - &process_options, - transaction_status_sender, - cache_block_meta_sender, - snapshot_config, - accounts_package_sender, - last_full_snapshot_slot, - ), - starting_snapshot_hashes, + blockstore_processor::process_blockstore_from_root( + blockstore, + bank_forks, + &process_options, + transaction_status_sender, + cache_block_meta_sender, + snapshot_config, + accounts_package_sender, + last_full_snapshot_slot, + ) + .map( + |(bank_forks, leader_schedule_cache, last_full_snapshot_slot)| { + ( + bank_forks, + leader_schedule_cache, + last_full_snapshot_slot, + starting_snapshot_hashes, + ) + }, ) }