From c70f5caf03f96831daa3240804180ee36dbe3ad9 Mon Sep 17 00:00:00 2001 From: Yoni Date: Sat, 12 Jan 2019 20:17:46 +0200 Subject: [PATCH] Add backwards check --- store/src/pmmr.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/store/src/pmmr.rs b/store/src/pmmr.rs index bf3986a74..2148ff681 100644 --- a/store/src/pmmr.rs +++ b/store/src/pmmr.rs @@ -193,7 +193,13 @@ impl PMMRBackend { data_dir.join(PMMR_LEAF_FILE).to_str().unwrap(), header.hash() ); - LeafSet::copy_snapshot(&leaf_set_path, &PathBuf::from(leaf_snapshot_path))?; + // Check for a ... (3 dot) ending version of the file - could probably be removed after mainnet + let compaitble_snapshot_path = PathBuf::from(leaf_snapshot_path.clone() + "..."); + if compaitble_snapshot_path.exists() { + LeafSet::copy_snapshot(&leaf_set_path, &compaitble_snapshot_path)?; + } else { + LeafSet::copy_snapshot(&leaf_set_path, &PathBuf::from(leaf_snapshot_path))?; + } } let leaf_set = LeafSet::open(&leaf_set_path)?;