ethcore/snapshot: fix double-lock in Service::feed_chunk (#289)

This commit is contained in:
Anonymous 2021-03-02 21:27:28 +08:00 committed by GitHub
parent efb80e1032
commit 63fdad8d86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -766,7 +766,7 @@ impl Service {
| Err(Error(SnapshotErrorKind::Snapshot(SnapshotError::RestorationAborted), _)) => (),
Err(e) => {
warn!("Encountered error during snapshot restoration: {}", e);
*self.restoration.lock() = None;
*restoration = None;
*self.status.lock() = RestorationStatus::Failed;
let _ = fs::remove_dir_all(self.restoration_dir());
}