From d089e18bbad8e1a00b540fbc594b256641d0722a Mon Sep 17 00:00:00 2001 From: apfitzge Date: Fri, 19 Aug 2022 09:34:35 -0500 Subject: [PATCH] create-snapshot check if snapshot slot exists (#27153) (cherry picked from commit 6da3eb028c90ec48808f0a7bf1d2f151c7175703) --- ledger-tool/src/main.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ledger-tool/src/main.rs b/ledger-tool/src/main.rs index 431ee64b2d001e..f78efd8f86af27 100644 --- a/ledger-tool/src/main.rs +++ b/ledger-tool/src/main.rs @@ -2686,6 +2686,11 @@ fn main() { value_t_or_exit!(arg_matches, "snapshot_slot", Slot) }; + assert!( + blockstore.meta(snapshot_slot).unwrap().is_some(), + "snapshot slot doesn't exist" + ); + let ending_slot = if is_minimized { let ending_slot = value_t_or_exit!(arg_matches, "ending_slot", Slot); if ending_slot <= snapshot_slot {