Add fn to check when to take snapshots (#19682)

This commit is contained in:
Brooks Prumo
2021-09-07 18:26:35 -05:00
committed by GitHub
parent 85571c93a4
commit 4a5f83d3a7
4 changed files with 37 additions and 16 deletions

View File

@ -1188,7 +1188,10 @@ fn load_frozen_forks(
if let Some(snapshot_config) = snapshot_config {
let block_height = new_root_bank.block_height();
if block_height % snapshot_config.full_snapshot_archive_interval_slots == 0 {
if snapshot_utils::should_take_full_snapshot(
block_height,
snapshot_config.full_snapshot_archive_interval_slots,
) {
*last_full_snapshot_slot = Some(*root);
new_root_bank.clean_accounts(true, true, *last_full_snapshot_slot);
snapshot_utils::snapshot_bank(