AccountsPackage::new less brittle (#23968)

This commit is contained in:
Jeff Washington (jwash) 2022-03-30 14:06:15 -05:00 committed by GitHub
parent 37497657c6
commit 82c5230bc2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -91,9 +91,11 @@ impl AccountsPackage {
.path()
.join(bank_snapshot_info.slot.to_string());
fs::create_dir_all(&snapshot_hardlink_dir)?;
let file_name =
snapshot_utils::path_to_file_name_str(&bank_snapshot_info.snapshot_path)?;
fs::hard_link(
&bank_snapshot_info.snapshot_path,
&snapshot_hardlink_dir.join(bank_snapshot_info.slot.to_string()),
&snapshot_hardlink_dir.join(file_name),
)?;
}