Remove accounts hack and correctly restore accounts store counts (#8569)

* Remove accounts hack and correctly restore append-vec counts

* Add test
This commit is contained in:
sakridge
2020-03-03 20:48:55 -08:00
committed by GitHub
parent 63ed892502
commit b084c1d437
3 changed files with 112 additions and 46 deletions

View File

@@ -447,18 +447,16 @@ pub fn bank_from_archive<P: AsRef<Path>>(
let mut snapshot_version = String::new();
File::open(unpacked_version_file).and_then(|mut f| f.read_to_string(&mut snapshot_version))?;
let mut bank = rebuild_bank_from_snapshots(
let bank = rebuild_bank_from_snapshots(
snapshot_version.trim(),
account_paths,
&unpacked_snapshots_dir,
unpacked_accounts_dir,
)?;
bank.work_around_dead_slots_cleaning_bug(true);
if !bank.verify_snapshot_bank() {
panic!("Snapshot bank for slot {} failed to verify", bank.slot());
}
bank.work_around_dead_slots_cleaning_bug(false);
measure.stop();
info!("{}", measure);