Remove unused code (#10762)
This commit is contained in:
parent
6fc5014b4d
commit
4ee217ba7c
@ -36,7 +36,6 @@ extern crate tempdir;
|
|||||||
|
|
||||||
mod error;
|
mod error;
|
||||||
mod service;
|
mod service;
|
||||||
mod stop_guard;
|
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
extern crate kvdb_rocksdb;
|
extern crate kvdb_rocksdb;
|
||||||
|
@ -23,7 +23,6 @@ use std::time::Duration;
|
|||||||
use ansi_term::Colour;
|
use ansi_term::Colour;
|
||||||
use ethereum_types::H256;
|
use ethereum_types::H256;
|
||||||
use io::{IoContext, TimerToken, IoHandler, IoService, IoError};
|
use io::{IoContext, TimerToken, IoHandler, IoService, IoError};
|
||||||
use stop_guard::StopGuard;
|
|
||||||
|
|
||||||
use sync::PrivateTxHandler;
|
use sync::PrivateTxHandler;
|
||||||
use blockchain::{BlockChainDB, BlockChainDBHandler};
|
use blockchain::{BlockChainDB, BlockChainDBHandler};
|
||||||
@ -84,7 +83,6 @@ pub struct ClientService {
|
|||||||
snapshot: Arc<SnapshotService>,
|
snapshot: Arc<SnapshotService>,
|
||||||
private_tx: Arc<PrivateTxService>,
|
private_tx: Arc<PrivateTxService>,
|
||||||
database: Arc<BlockChainDB>,
|
database: Arc<BlockChainDB>,
|
||||||
_stop_guard: StopGuard,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ClientService {
|
impl ClientService {
|
||||||
@ -152,15 +150,12 @@ impl ClientService {
|
|||||||
|
|
||||||
spec.engine.register_client(Arc::downgrade(&client) as _);
|
spec.engine.register_client(Arc::downgrade(&client) as _);
|
||||||
|
|
||||||
let stop_guard = StopGuard::new();
|
|
||||||
|
|
||||||
Ok(ClientService {
|
Ok(ClientService {
|
||||||
io_service: Arc::new(io_service),
|
io_service: Arc::new(io_service),
|
||||||
client: client,
|
client: client,
|
||||||
snapshot: snapshot,
|
snapshot: snapshot,
|
||||||
private_tx,
|
private_tx,
|
||||||
database: blockchain_db,
|
database: blockchain_db,
|
||||||
_stop_guard: stop_guard,
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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)
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user