refactor AccountsToStore (#34185)

Co-authored-by: HaoranYi <haoran.yi@solana.com>
This commit is contained in:
HaoranYi 2023-11-21 09:27:31 -06:00 committed by GitHub
parent 504f2ee892
commit 90b11a608b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -378,7 +378,7 @@ impl CurrentAncientAppendVec {
let accounts = accounts_to_store.get(storage_selector); let accounts = accounts_to_store.get(storage_selector);
db.store_accounts_frozen( db.store_accounts_frozen(
(self.slot(), accounts, accounts_to_store.slot), (self.slot(), accounts, accounts_to_store.slot()),
None::<Vec<AccountHash>>, None::<Vec<AccountHash>>,
self.append_vec(), self.append_vec(),
None, None,

View File

@ -867,7 +867,7 @@ pub struct AccountsToStore<'a> {
/// if 'accounts' contains more items than can be contained in the primary storage, then we have to split these accounts. /// if 'accounts' contains more items than can be contained in the primary storage, then we have to split these accounts.
/// 'index_first_item_overflow' specifies the index of the first item in 'accounts' that will go into the overflow storage /// 'index_first_item_overflow' specifies the index of the first item in 'accounts' that will go into the overflow storage
index_first_item_overflow: usize, index_first_item_overflow: usize,
pub slot: Slot, slot: Slot,
} }
impl<'a> AccountsToStore<'a> { impl<'a> AccountsToStore<'a> {
@ -915,6 +915,10 @@ impl<'a> AccountsToStore<'a> {
}; };
&self.accounts[range] &self.accounts[range]
} }
pub fn slot(&self) -> Slot {
self.slot
}
} }
/// capacity of an ancient append vec /// capacity of an ancient append vec