fix indentation format problem (#15618)

* fix indentation format problem

* fix indentation format problem
This commit is contained in:
Jeff Washington (jwash)
2021-03-02 10:46:00 -06:00
committed by GitHub
parent aad79d9d5c
commit da47ab7e50

View File

@ -3499,56 +3499,60 @@ impl AccountsDb {
keys.par_chunks(chunks) keys.par_chunks(chunks)
.map(|pubkeys| { .map(|pubkeys| {
let mut sum = 0u128; let mut sum = 0u128;
let result: Vec<Hash> = let result: Vec<Hash> = pubkeys
pubkeys .iter()
.iter() .filter_map(|pubkey| {
.filter_map(|pubkey| { if let Some((lock, index)) =
if let Some((lock, index)) = self.accounts_index.get(pubkey, Some(ancestors), Some(slot))
self.accounts_index.get(pubkey, Some(ancestors), Some(slot)) {
{ let (slot, account_info) = &lock.slot_list()[index];
let (slot, account_info) = &lock.slot_list()[index]; if account_info.lamports != 0 {
if account_info.lamports != 0 { self.get_account_accessor_from_cache_or_storage(
self.get_account_accessor_from_cache_or_storage(
*slot,
pubkey,
account_info.store_id,
account_info.offset,
)
.get_loaded_account()
.and_then(|loaded_account| {
let loaded_hash = loaded_account.loaded_hash();
let balance = Self::account_balance_for_capitalization(
account_info.lamports,
loaded_account.owner(),
loaded_account.executable(),
simple_capitalization_enabled,
);
if check_hash {
let computed_hash = loaded_account.compute_hash(
*slot, *slot,
&self.cluster_type.expect(
"Cluster type must be set at initialization",
),
pubkey, pubkey,
); account_info.store_id,
if computed_hash != *loaded_hash { account_info.offset,
mismatch_found.fetch_add(1, Ordering::Relaxed); )
return None; .get_loaded_account()
} .and_then(
} |loaded_account| {
let loaded_hash = loaded_account.loaded_hash();
let balance =
Self::account_balance_for_capitalization(
account_info.lamports,
loaded_account.owner(),
loaded_account.executable(),
simple_capitalization_enabled,
);
sum += balance as u128; if check_hash {
Some(*loaded_hash) let computed_hash = loaded_account
}) .compute_hash(
} else { *slot,
None &self.cluster_type.expect(
} "Cluster type must be set at initialization",
),
pubkey,
);
if computed_hash != *loaded_hash {
mismatch_found
.fetch_add(1, Ordering::Relaxed);
return None;
}
}
sum += balance as u128;
Some(*loaded_hash)
},
)
} else { } else {
None None
} }
}) } else {
.collect(); None
}
})
.collect();
let mut total = total_lamports.lock().unwrap(); let mut total = total_lamports.lock().unwrap();
*total = *total =
AccountsHash::checked_cast_for_capitalization(*total as u128 + sum); AccountsHash::checked_cast_for_capitalization(*total as u128 + sum);