Add triple dot to check_and_remove_files + typo

This commit is contained in:
Yoni 2019-01-12 21:11:03 +02:00
parent c70f5caf03
commit 51ad711063
2 changed files with 5 additions and 3 deletions

View file

@ -1451,7 +1451,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 pmmr_files_expected: HashSet<_> = PMMR_FILES let mut pmmr_files_expected: HashSet<_> = PMMR_FILES
.iter() .iter()
.cloned() .cloned()
.map(|s| { .map(|s| {
@ -1462,6 +1462,8 @@ 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

@ -194,8 +194,8 @@ impl<T: PMMRable> PMMRBackend<T> {
header.hash() header.hash()
); );
// Check for a ... (3 dot) ending version of the file - could probably be removed after mainnet // 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() + "..."); let compatible_snapshot_path = PathBuf::from(leaf_snapshot_path.clone() + "...");
if compaitble_snapshot_path.exists() { if compatible_snapshot_path.exists() {
LeafSet::copy_snapshot(&leaf_set_path, &compaitble_snapshot_path)?; LeafSet::copy_snapshot(&leaf_set_path, &compaitble_snapshot_path)?;
} else { } else {
LeafSet::copy_snapshot(&leaf_set_path, &PathBuf::from(leaf_snapshot_path))?; LeafSet::copy_snapshot(&leaf_set_path, &PathBuf::from(leaf_snapshot_path))?;