diff --git a/ethcore/service/src/lib.rs b/ethcore/service/src/lib.rs index 67292e1d8..b9a8c15b3 100644 --- a/ethcore/service/src/lib.rs +++ b/ethcore/service/src/lib.rs @@ -36,7 +36,6 @@ extern crate tempdir; mod error; mod service; -mod stop_guard; #[cfg(test)] extern crate kvdb_rocksdb; diff --git a/ethcore/service/src/service.rs b/ethcore/service/src/service.rs index bdc743581..176908056 100644 --- a/ethcore/service/src/service.rs +++ b/ethcore/service/src/service.rs @@ -23,7 +23,6 @@ use std::time::Duration; use ansi_term::Colour; use ethereum_types::H256; use io::{IoContext, TimerToken, IoHandler, IoService, IoError}; -use stop_guard::StopGuard; use sync::PrivateTxHandler; use blockchain::{BlockChainDB, BlockChainDBHandler}; @@ -84,7 +83,6 @@ pub struct ClientService { snapshot: Arc, private_tx: Arc, database: Arc, - _stop_guard: StopGuard, } impl ClientService { @@ -152,15 +150,12 @@ impl ClientService { spec.engine.register_client(Arc::downgrade(&client) as _); - let stop_guard = StopGuard::new(); - Ok(ClientService { io_service: Arc::new(io_service), client: client, snapshot: snapshot, private_tx, database: blockchain_db, - _stop_guard: stop_guard, }) } diff --git a/ethcore/service/src/stop_guard.rs b/ethcore/service/src/stop_guard.rs deleted file mode 100644 index 168219520..000000000 --- a/ethcore/service/src/stop_guard.rs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2015-2019 Parity Technologies (UK) Ltd. -// This file is part of Parity Ethereum. - -// Parity Ethereum is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity Ethereum is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity Ethereum. If not, see . - -//! Stop guard mod - -use std::sync::Arc; -use std::sync::atomic::*; - -/// Stop guard that will set a stop flag on drop -pub struct StopGuard { - flag: Arc, -} - -impl StopGuard { - /// Create a stop guard - pub fn new() -> StopGuard { - StopGuard { - flag: Arc::new(AtomicBool::new(false)) - } - } -} - -impl Drop for StopGuard { - fn drop(&mut self) { - self.flag.store(true, Ordering::Relaxed) - } -}