mirror of
https://github.com/mimblewimble/grin.git
synced 2025-01-21 11:31:08 +03:00
Add backwards check
This commit is contained in:
parent
383d35950e
commit
c70f5caf03
1 changed files with 7 additions and 1 deletions
|
@ -193,8 +193,14 @@ 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
|
||||||
|
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))?;
|
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)?;
|
||||||
let prune_list = PruneList::open(&data_dir.join(PMMR_PRUN_FILE))?;
|
let prune_list = PruneList::open(&data_dir.join(PMMR_PRUN_FILE))?;
|
||||||
|
|
Loading…
Reference in a new issue