Skip to content

Commit

Permalink
Merge pull request #1634 from subspace/fix-wipe-unknown-plot
Browse files Browse the repository at this point in the history
Fix wiping of unknown plot
  • Loading branch information
nazar-pc authored Jul 3, 2023
2 parents f1cc493 + ff0e78d commit 35c8695
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions crates/subspace-farmer/src/single_disk_plot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1202,18 +1202,19 @@ impl SingleDiskPlot {
/// Wipe everything that belongs to this single disk plot
pub fn wipe(directory: &Path) -> io::Result<()> {
let single_disk_plot_info_path = directory.join(SingleDiskPlotInfo::FILE_NAME);
match SingleDiskPlotInfo::load_from(directory)?.ok_or_else(|| {
io::Error::new(
io::ErrorKind::NotFound,
format!(
"Single disk plot info not found at {}",
single_disk_plot_info_path.display()
),
)
}) {
Ok(single_disk_plot_info) => {
match SingleDiskPlotInfo::load_from(directory) {
Ok(Some(single_disk_plot_info)) => {
info!("Found single disk plot {}", single_disk_plot_info.id());
}
Ok(None) => {
return Err(io::Error::new(
io::ErrorKind::NotFound,
format!(
"Single disk plot info not found at {}",
single_disk_plot_info_path.display()
),
));
}
Err(error) => {
warn!("Found unknown single disk plot: {}", error);
}
Expand Down

0 comments on commit 35c8695

Please sign in to comment.