From 09a3b5001c702423f103f5bda1295b89cbd403e0 Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Tue, 22 Dec 2020 18:28:04 -0800 Subject: [PATCH] Add log message for when a local snapshot is too old (cherry picked from commit 65dcb3dc816c15cecb978bf8f760a2f27287d1b2) --- validator/src/main.rs | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/validator/src/main.rs b/validator/src/main.rs index 6f96798313..079c6839a8 100644 --- a/validator/src/main.rs +++ b/validator/src/main.rs @@ -731,10 +731,21 @@ fn rpc_bootstrap( get_highest_snapshot_archive_path(ledger_path) .map(|(_path, (slot, _hash, _compression))| slot) { - if highest_local_snapshot_slot > snapshot_hash.0.saturating_sub(maximum_local_snapshot_age) { - info!("Reusing local snapshot at slot {} instead of downloading a newer snapshot for slot {}", - highest_local_snapshot_slot, snapshot_hash.0); + if highest_local_snapshot_slot + > snapshot_hash.0.saturating_sub(maximum_local_snapshot_age) + { + info!( + "Reusing local snapshot at slot {} instead \ + of downloading a newer snapshot for slot {}", + highest_local_snapshot_slot, snapshot_hash.0 + ); use_local_snapshot = true; + } else { + info!( + "Local snapshot from slot {} is too old. \ + Downloading a newer snapshot for slot {}", + highest_local_snapshot_slot, snapshot_hash.0 + ); } }