Remove unused code (#10762)

This commit is contained in:
David 2019-06-19 16:08:21 +02:00 committed by Andrew Jones
parent 6fc5014b4d
commit 4ee217ba7c
3 changed files with 0 additions and 46 deletions

View File

@ -36,7 +36,6 @@ extern crate tempdir;
mod error;
mod service;
mod stop_guard;
#[cfg(test)]
extern crate kvdb_rocksdb;

View File

@ -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<SnapshotService>,
private_tx: Arc<PrivateTxService>,
database: Arc<BlockChainDB>,
_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,
})
}

View File

@ -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 <http://www.gnu.org/licenses/>.
//! 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<AtomicBool>,
}
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)
}
}