Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
Remove NetworkContext::io_channel() (#8625)
Browse files Browse the repository at this point in the history
* Remove io_channel()

* Fix warning
  • Loading branch information
tomaka authored and 5chdn committed May 15, 2018
1 parent 0c4d2fb commit 8e078b1
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 12 deletions.
4 changes: 0 additions & 4 deletions util/network-devp2p/src/host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<NetworkIoMessage> {
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));
Expand Down
8 changes: 0 additions & 8 deletions util/network/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -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<u8>) -> Result<(), Error>;

/// Get an IoChannel.
fn io_channel(&self) -> IoChannel<NetworkIoMessage>;

/// Disconnect a peer and prevent it from connecting again.
fn disable_peer(&self, peer: PeerId);

Expand Down Expand Up @@ -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<NetworkIoMessage> {
(**self).io_channel()
}

fn disable_peer(&self, peer: PeerId) {
(**self).disable_peer(peer)
}
Expand Down

0 comments on commit 8e078b1

Please sign in to comment.