From eed81388d5142c74547c503e95e084d6ab7e8d42 Mon Sep 17 00:00:00 2001 From: Antioch Peverell Date: Mon, 25 Feb 2019 13:20:15 +0000 Subject: [PATCH] cleanup legacy "3 dot" check (#2625) --- chain/src/txhashset/txhashset.rs | 4 +--- store/src/pmmr.rs | 8 +------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/chain/src/txhashset/txhashset.rs b/chain/src/txhashset/txhashset.rs index 31d7ac084..31fc9f7e0 100644 --- a/chain/src/txhashset/txhashset.rs +++ b/chain/src/txhashset/txhashset.rs @@ -1503,7 +1503,7 @@ fn check_and_remove_files(txhashset_path: &PathBuf, header: &BlockHeader) -> Res } // Then compare the files found in the subdirectories - let mut pmmr_files_expected: HashSet<_> = PMMR_FILES + let pmmr_files_expected: HashSet<_> = PMMR_FILES .iter() .cloned() .map(|s| { @@ -1514,8 +1514,6 @@ fn check_and_remove_files(txhashset_path: &PathBuf, header: &BlockHeader) -> Res } }) .collect(); - // prevent checker from deleting 3 dot file, could be removed after mainnet - pmmr_files_expected.insert(format!("pmmr_leaf.bin.{}...", header.hash())); let subdirectories = fs::read_dir(txhashset_path)?; for subdirectory in subdirectories { diff --git a/store/src/pmmr.rs b/store/src/pmmr.rs index 4fc031d43..200dbae9c 100644 --- a/store/src/pmmr.rs +++ b/store/src/pmmr.rs @@ -199,13 +199,7 @@ impl PMMRBackend { data_dir.join(PMMR_LEAF_FILE).to_str().unwrap(), header.hash() ); - // Check for a ... (3 dot) ending version of the file - could probably be removed after mainnet - let compatible_snapshot_path = PathBuf::from(leaf_snapshot_path.clone() + "..."); - if compatible_snapshot_path.exists() { - LeafSet::copy_snapshot(&leaf_set_path, &compatible_snapshot_path)?; - } else { - LeafSet::copy_snapshot(&leaf_set_path, &PathBuf::from(leaf_snapshot_path))?; - } + LeafSet::copy_snapshot(&leaf_set_path, &PathBuf::from(leaf_snapshot_path))?; } let leaf_set = LeafSet::open(&leaf_set_path)?;