add _inclusive (#27300)

This commit is contained in:
Jeff Washington (jwash) 2022-08-22 14:55:58 -05:00 committed by GitHub
parent ae02d955b4
commit 9703855a80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -3013,16 +3013,16 @@ impl AccountsDb {
/// ```
///
/// This filtering step can be skipped if there is no `last_full_snapshot_slot`, or if the
/// `max_clean_root` is less-than-or-equal-to the `last_full_snapshot_slot`.
/// `max_clean_root_inclusive` is less-than-or-equal-to the `last_full_snapshot_slot`.
fn filter_zero_lamport_clean_for_incremental_snapshots(
&self,
max_clean_root: Option<Slot>,
max_clean_root_inclusive: Option<Slot>,
last_full_snapshot_slot: Option<Slot>,
store_counts: &HashMap<AppendVecId, (usize, HashSet<Pubkey>)>,
purges_zero_lamports: &mut HashMap<Pubkey, (SlotList<AccountInfo>, RefCount)>,
) {
let should_filter_for_incremental_snapshots =
max_clean_root.unwrap_or(Slot::MAX) > last_full_snapshot_slot.unwrap_or(Slot::MAX);
let should_filter_for_incremental_snapshots = max_clean_root_inclusive.unwrap_or(Slot::MAX)
> last_full_snapshot_slot.unwrap_or(Slot::MAX);
assert!(
last_full_snapshot_slot.is_some() || !should_filter_for_incremental_snapshots,
"if filtering for incremental snapshots, then snapshots should be enabled",