diff --git a/store/src/leaf_set.rs b/store/src/leaf_set.rs index c1f718a0..f75d4e14 100644 --- a/store/src/leaf_set.rs +++ b/store/src/leaf_set.rs @@ -155,7 +155,7 @@ impl LeafSet { let mut cp_bitmap = self.bitmap.clone(); cp_bitmap.run_optimize(); - let cp_path = self.path.join(header.hash().to_string()); + let cp_path = format!("{}.{}", self.path.to_str().unwrap(), header.hash()); let mut file = BufWriter::new(File::create(cp_path)?); file.write_all(&cp_bitmap.serialize())?; file.flush()?; diff --git a/store/src/pmmr.rs b/store/src/pmmr.rs index 5f770088..bf3986a7 100644 --- a/store/src/pmmr.rs +++ b/store/src/pmmr.rs @@ -188,11 +188,12 @@ impl PMMRBackend { // If we received a rewound "snapshot" leaf_set file move it into // place so we use it. if let Some(header) = header { - let _leaf_snapshot_path = (data_dir.join(PMMR_LEAF_FILE).to_string_lossy() - + header.hash().to_string().as_ref()) - .into_owned(); - let leaf_snapshot_path = PathBuf::from(_leaf_snapshot_path); - LeafSet::copy_snapshot(&leaf_set_path, &leaf_snapshot_path)?; + let leaf_snapshot_path = format!( + "{}.{}", + data_dir.join(PMMR_LEAF_FILE).to_str().unwrap(), + header.hash() + ); + LeafSet::copy_snapshot(&leaf_set_path, &PathBuf::from(leaf_snapshot_path))?; } let leaf_set = LeafSet::open(&leaf_set_path)?;