Shutdown the Snapshot Service early (#8658)

* Shutdown the Snapshot Service when shutting down the runner

* Rename `service` to `client_service`

* Fix tests
This commit is contained in:
Nicolas Gotchac
2018-05-29 12:23:15 +02:00
committed by Andronik Ordian
parent 68d16b723a
commit 7fcb082cad
6 changed files with 25 additions and 3 deletions

View File

@@ -29,7 +29,7 @@ use sync::PrivateTxHandler;
use ethcore::client::{Client, ClientConfig, ChainNotify, ClientIoMessage};
use ethcore::miner::Miner;
use ethcore::snapshot::service::{Service as SnapshotService, ServiceParams as SnapServiceParams};
use ethcore::snapshot::{RestorationStatus};
use ethcore::snapshot::{SnapshotService as _SnapshotService, RestorationStatus};
use ethcore::spec::Spec;
use ethcore::account_provider::AccountProvider;
@@ -168,6 +168,11 @@ impl ClientService {
/// Get a handle to the database.
pub fn db(&self) -> Arc<KeyValueDB> { self.database.clone() }
/// Shutdown the Client Service
pub fn shutdown(&self) {
self.snapshot.shutdown();
}
}
/// IO interface for the Client handler