Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cleanup legacy "3 dot" incorrect filename check #2625

Merged
merged 1 commit into from
Feb 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions chain/src/txhashset/txhashset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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| {
Expand All @@ -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 {
Expand Down
8 changes: 1 addition & 7 deletions store/src/pmmr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,13 +199,7 @@ impl<T: PMMRable> PMMRBackend<T> {
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)?;
Expand Down