Eliminate to_loadresult()
This commit is contained in:
parent
3d4bf1d00a
commit
cf5048faaa
|
@ -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<StartingSnapshotHashes>,
|
||||
) -> 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,7 +107,6 @@ pub fn load(
|
|||
)
|
||||
};
|
||||
|
||||
to_loadresult(
|
||||
blockstore_processor::process_blockstore_from_root(
|
||||
blockstore,
|
||||
bank_forks,
|
||||
|
@ -133,9 +116,17 @@ pub fn load(
|
|||
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,
|
||||
)
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
|
|
Loading…
Reference in New Issue