Add log message for when a local snapshot is too old

This commit is contained in:
Michael Vines 2020-12-22 18:28:04 -08:00
parent 50710473a8
commit 65dcb3dc81
1 changed files with 14 additions and 3 deletions

View File

@ -663,10 +663,21 @@ fn rpc_bootstrap(
get_highest_snapshot_archive_path(ledger_path) get_highest_snapshot_archive_path(ledger_path)
.map(|(_path, (slot, _hash, _compression))| slot) .map(|(_path, (slot, _hash, _compression))| slot)
{ {
if highest_local_snapshot_slot > snapshot_hash.0.saturating_sub(maximum_local_snapshot_age) { if highest_local_snapshot_slot
info!("Reusing local snapshot at slot {} instead of downloading a newer snapshot for slot {}", > snapshot_hash.0.saturating_sub(maximum_local_snapshot_age)
highest_local_snapshot_slot, snapshot_hash.0); {
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; 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
);
} }
} }