From 8e078b1d83bf708ef29bbbb166ab5c6edfdaa7b3 Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Tue, 15 May 2018 17:03:09 +0200 Subject: [PATCH] Remove NetworkContext::io_channel() (#8625) * Remove io_channel() * Fix warning --- util/network-devp2p/src/host.rs | 4 ---- util/network/src/lib.rs | 8 -------- 2 files changed, 12 deletions(-) diff --git a/util/network-devp2p/src/host.rs b/util/network-devp2p/src/host.rs index 3c8643fe6..4cca2e6e5 100644 --- a/util/network-devp2p/src/host.rs +++ b/util/network-devp2p/src/host.rs @@ -153,10 +153,6 @@ impl<'s> NetworkContextTrait for NetworkContext<'s> { self.session_id.map_or_else(|| Err(ErrorKind::Expired.into()), |id| self.send(id, packet_id, data)) } - fn io_channel(&self) -> IoChannel { - self.io.channel() - } - fn disable_peer(&self, peer: PeerId) { self.io.message(NetworkIoMessage::DisablePeer(peer)) .unwrap_or_else(|e| warn!("Error sending network IO message: {:?}", e)); diff --git a/util/network/src/lib.rs b/util/network/src/lib.rs index 673e4dab3..1327a9ad5 100644 --- a/util/network/src/lib.rs +++ b/util/network/src/lib.rs @@ -39,7 +39,6 @@ use std::str::{self, FromStr}; use std::sync::Arc; use std::time::Duration; use ipnetwork::{IpNetwork, IpNetworkError}; -use io::IoChannel; use ethkey::Secret; use ethereum_types::{H256, H512}; use rlp::{Decodable, DecoderError, Rlp}; @@ -257,9 +256,6 @@ pub trait NetworkContext { /// Respond to a current network message. Panics if no there is no packet in the context. If the session is expired returns nothing. fn respond(&self, packet_id: PacketId, data: Vec) -> Result<(), Error>; - /// Get an IoChannel. - fn io_channel(&self) -> IoChannel; - /// Disconnect a peer and prevent it from connecting again. fn disable_peer(&self, peer: PeerId); @@ -298,10 +294,6 @@ impl<'a, T> NetworkContext for &'a T where T: ?Sized + NetworkContext { (**self).respond(packet_id, data) } - fn io_channel(&self) -> IoChannel { - (**self).io_channel() - } - fn disable_peer(&self, peer: PeerId) { (**self).disable_peer(peer) }