cleanup legacy "3 dot" check (#2625)

This commit is contained in:
Antioch Peverell 2019-02-25 13:20:15 +00:00 committed by GitHub
parent 391e311f4c
commit eed81388d5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 10 deletions

View file

@ -1503,7 +1503,7 @@ fn check_and_remove_files(txhashset_path: &PathBuf, header: &BlockHeader) -> Res
} }
// Then compare the files found in the subdirectories // Then compare the files found in the subdirectories
let mut pmmr_files_expected: HashSet<_> = PMMR_FILES let pmmr_files_expected: HashSet<_> = PMMR_FILES
.iter() .iter()
.cloned() .cloned()
.map(|s| { .map(|s| {
@ -1514,8 +1514,6 @@ fn check_and_remove_files(txhashset_path: &PathBuf, header: &BlockHeader) -> Res
} }
}) })
.collect(); .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)?; let subdirectories = fs::read_dir(txhashset_path)?;
for subdirectory in subdirectories { for subdirectory in subdirectories {

View file

@ -199,13 +199,7 @@ impl<T: PMMRable> PMMRBackend<T> {
data_dir.join(PMMR_LEAF_FILE).to_str().unwrap(), data_dir.join(PMMR_LEAF_FILE).to_str().unwrap(),
header.hash() header.hash()
); );
// Check for a ... (3 dot) ending version of the file - could probably be removed after mainnet LeafSet::copy_snapshot(&leaf_set_path, &PathBuf::from(leaf_snapshot_path))?;
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))?;
}
} }
let leaf_set = LeafSet::open(&leaf_set_path)?; let leaf_set = LeafSet::open(&leaf_set_path)?;