use slots returned from get_snapshot_storages to sort (#17638) (#17695)

* use slots returned from get_snapshot_storages to sort

    * add tests

    (cherry picked from commit 9388aaca15)

    # Conflicts:
    #       runtime/src/accounts_db.rs
    #       runtime/src/sorted_storages.rs

Co-authored-by: Jeff Washington (jwash) <wash678@gmail.com>
This commit is contained in:
mergify[bot]
2021-06-04 10:14:37 -05:00
committed by GitHub
parent 5e7db52087
commit 78147d48e4
3 changed files with 126 additions and 45 deletions

View File

@@ -11,6 +11,7 @@ use {
snapshot_package::{
AccountsPackage, AccountsPackagePre, AccountsPackageSendError, AccountsPackageSender,
},
sorted_storages::SortedStorages,
},
bincode::{config::Options, serialize_into},
bzip2::bufread::BzDecoder,
@@ -998,8 +999,9 @@ pub fn process_accounts_package_pre(
let hash = accounts_package.hash; // temporarily remaining here
if let Some(expected_hash) = accounts_package.hash_for_testing {
let sorted_storages = SortedStorages::new(&accounts_package.storages);
let (hash, lamports) = AccountsDb::calculate_accounts_hash_without_index(
&accounts_package.storages,
&sorted_storages,
thread_pool,
crate::accounts_hash::HashStats::default(),
false,