diff --git a/chain/src/txhashset/txhashset.rs b/chain/src/txhashset/txhashset.rs index 6ee1dc219..cbcf2d657 100644 --- a/chain/src/txhashset/txhashset.rs +++ b/chain/src/txhashset/txhashset.rs @@ -1456,7 +1456,7 @@ fn check_and_remove_files(txhashset_path: &PathBuf, header: &BlockHeader) -> Res } // Then compare the files found in the subdirectories - let pmmr_files_expected: HashSet<_> = PMMR_FILES + let mut pmmr_files_expected: HashSet<_> = PMMR_FILES .iter() .cloned() .map(|s| { @@ -1467,6 +1467,8 @@ 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 { diff --git a/core/src/core/hash.rs b/core/src/core/hash.rs index 378940436..446ee8910 100644 --- a/core/src/core/hash.rs +++ b/core/src/core/hash.rs @@ -41,7 +41,7 @@ impl fmt::Debug for Hash { let hash_hex = self.to_hex(); const NUM_SHOW: usize = 12; - write!(f, "{}...", &hash_hex[..NUM_SHOW]) + write!(f, "{}", &hash_hex[..NUM_SHOW]) } } diff --git a/src/bin/tui/status.rs b/src/bin/tui/status.rs index 45d81e03b..afc92cd17 100644 --- a/src/bin/tui/status.rs +++ b/src/bin/tui/status.rs @@ -241,7 +241,7 @@ impl TUIStatusListener for TUIStatusView { t.set_content(stats.peer_count.to_string()); }); c.call_on_id("tip_hash", |t: &mut TextView| { - t.set_content(stats.head.last_block_h.to_string()); + t.set_content(stats.head.last_block_h.to_string() + "..."); }); c.call_on_id("chain_height", |t: &mut TextView| { t.set_content(stats.head.height.to_string()); @@ -250,7 +250,7 @@ impl TUIStatusListener for TUIStatusView { t.set_content(stats.head.total_difficulty.to_string()); }); c.call_on_id("basic_header_tip_hash", |t: &mut TextView| { - t.set_content(stats.header_head.last_block_h.to_string()); + t.set_content(stats.header_head.last_block_h.to_string() + "..."); }); c.call_on_id("basic_header_chain_height", |t: &mut TextView| { t.set_content(stats.header_head.height.to_string()); diff --git a/store/src/pmmr.rs b/store/src/pmmr.rs index bf3986a74..c6cf6b6c2 100644 --- a/store/src/pmmr.rs +++ b/store/src/pmmr.rs @@ -193,7 +193,13 @@ impl PMMRBackend { data_dir.join(PMMR_LEAF_FILE).to_str().unwrap(), header.hash() ); - LeafSet::copy_snapshot(&leaf_set_path, &PathBuf::from(leaf_snapshot_path))?; + // 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))?; + } } let leaf_set = LeafSet::open(&leaf_set_path)?;