pub fn ban_peer(&self, peer_addr: &SocketAddr) {
		if let Err(e) = self.update_state(peer_addr.clone(), State::Banned) {
			error!(LOGGER, "Couldn't ban {}: {:?}", peer_addr, e);
		}

		if let Some(peer) = self.get_peer(peer_addr) {
			debug!(LOGGER, "Banning peer {}", peer_addr);
			// setting peer status will get it removed at the next clean_peer
			let peer = peer.write().unwrap();
			peer.set_banned();
			peer.stop();
		}
	}
/// Bans a peer, disconnecting it if we're currently connected
Bans a peer, disconnecting it if we're currently connected
Bans a peer disconnecting it if we ' re currently connected
pub fn ban_peer(&self, peer_addr: &SocketAddr) {
		if let Err(e) = self.update_state(peer_addr.clone(), State::Banned) {
			error!(LOGGER, "Couldn't ban {}: {:?}", peer_addr, e);
		}
		if let Some(peer) = self.get_peer(peer_addr) {
			debug!(LOGGER, "Banning peer {}", peer_addr);
			// setting peer status will get it removed at the next clean_peer
			let peer = peer.write().unwrap();
			peer.set_banned();
			peer.stop();
		}
	}
pub fn ban_peer ( & self , peer_addr : & SocketAddr ) { if let Err ( e ) = self . update_state ( peer_addr . clone ( ) , State :: Banned ) { error ! ( LOGGER " " peer_addr e ) ; } if let Some ( peer ) = self . get_peer ( peer_addr ) { debug ! ( LOGGER " " peer_addr ) ; // setting peer status will get it removed at the next clean_peer let peer = peer . write ( ) . unwrap ( ) ; peer . set_banned ( ) ; peer . stop ( ) ; } }
Bans a peer, disconnecting it if we're currently connected
Bans a peer disconnecting it if we ' re currently connected
&self
peer_addr
&SocketAddr