From: Matt Corallo Date: Sun, 16 Jul 2023 20:41:00 +0000 (+0000) Subject: Only generate as many symlinks as we need (rather than 27 years worth) X-Git-Url: http://git.bitcoin.ninja/index.cgi?p=rapid-gossip-sync-server;a=commitdiff_plain;h=7eda680f9e4faf746835d46590e58f4fcfe3b64e Only generate as many symlinks as we need (rather than 27 years worth) --- diff --git a/src/snapshot.rs b/src/snapshot.rs index 96c1e4d..4a86f98 100644 --- a/src/snapshot.rs +++ b/src/snapshot.rs @@ -105,7 +105,9 @@ impl Snapshotter where L::Target: Logger { symlink(&relative_dummy_snapshot_path, &dummy_symlink_path).unwrap(); } - for i in 0..10_001u64 { + // Number of intervals since Jan 1, 2022, a few months before RGS server was released. + let symlink_count = (reference_timestamp - 1640995200) / config::SNAPSHOT_CALCULATION_INTERVAL as u64; + for i in 0..symlink_count { // let's create non-dummy-symlinks // first, determine which snapshot range should be referenced