fn peerset_report_reject(&mut self, index: substrate_peerset::IncomingIndex) {
		let incoming = if let Some(pos) = self.incoming.iter().position(|i| i.incoming_id == index) {
			self.incoming.remove(pos)
		} else {
			error!(target: "sub-libp2p", "PSM => Reject({:?}): Invalid index", index);
			return
		};

		if !incoming.alive {
			error!(target: "sub-libp2p", "PSM => Reject({:?}, {:?}): Obsolete incoming, \
				ignoring", index, incoming.peer_id);
			return
		}

		let state = if let Some(state) = self.peers.get_mut(&incoming.peer_id) {
			state
		} else {
			error!(target: "sub-libp2p", "State mismatch in libp2p: no entry in peers \
				corresponding to an alive incoming");
			return
		};

		let connected_point = if let PeerState::Incoming { connected_point } = state {
			connected_point.clone()
		} else {
			error!(target: "sub-libp2p", "State mismatch in libp2p: entry in peers corresponding \
				to an alive incoming is not in incoming state");
			return
		};

		debug!(target: "sub-libp2p", "PSM => Reject({:?}, {:?}): Rejecting connection through \
			{:?}", index, incoming.peer_id, connected_point);
		debug!(target: "sub-libp2p", "Handler({:?}) <= Disable", incoming.peer_id);
		self.events.push(NetworkBehaviourAction::SendEvent {
			peer_id: incoming.peer_id,
			event: CustomProtoHandlerIn::Disable,
		});
		*state = PeerState::Disabled { open: false, connected_point, banned_until: None };
	}
/// Function that is called when the peerset wants us to reject an incoming node.
Function that is called when the peerset wants us to reject an incoming node.
Function that is called when the peerset wants us to reject an incoming node .
fn peerset_report_reject(&mut self, index: substrate_peerset::IncomingIndex) {
		let incoming = if let Some(pos) = self.incoming.iter().position(|i| i.incoming_id == index) {
			self.incoming.remove(pos)
		} else {
			error!(target: "sub-libp2p", "PSM => Reject({:?}): Invalid index", index);
			return
		};
		if !incoming.alive {
			error!(target: "sub-libp2p", "PSM => Reject({:?}, {:?}): Obsolete incoming, \
				ignoring", index, incoming.peer_id);
			return
		}
		let state = if let Some(state) = self.peers.get_mut(&incoming.peer_id) {
			state
		} else {
			error!(target: "sub-libp2p", "State mismatch in libp2p: no entry in peers \
				corresponding to an alive incoming");
			return
		};
		let connected_point = if let PeerState::Incoming { connected_point } = state {
			connected_point.clone()
		} else {
			error!(target: "sub-libp2p", "State mismatch in libp2p: entry in peers corresponding \
				to an alive incoming is not in incoming state");
			return
		};
		debug!(target: "sub-libp2p", "PSM => Reject({:?}, {:?}): Rejecting connection through \
			{:?}", index, incoming.peer_id, connected_point);
		debug!(target: "sub-libp2p", "Handler({:?}) <= Disable", incoming.peer_id);
		self.events.push(NetworkBehaviourAction::SendEvent {
			peer_id: incoming.peer_id,
			event: CustomProtoHandlerIn::Disable,
		});
		*state = PeerState::Disabled { open: false, connected_point, banned_until: None };
	}
fn peerset_report_reject ( & mut self , index : substrate_peerset :: IncomingIndex ) { let incoming = if let Some ( pos ) = self . incoming . iter ( ) . position ( | i | i . incoming_id == index ) { self . incoming . remove ( pos ) } else { error ! ( target " " " " index ) ; return } ; if ! incoming . alive { error ! ( target " " " \
 " index incoming peer_id ) ; return } let state = if let Some ( state ) = self . peers . get_mut ( & incoming . peer_id ) { state } else { error ! ( target " " " \
 " ) ; return } ; let connected_point = if let PeerState :: Incoming { connected_point } = state { connected_point . clone ( ) } else { error ! ( target " " " \
 " ) ; return } ; debug ! ( target " " " \
 " index incoming peer_id connected_point ) ; debug ! ( target " " " " incoming peer_id ) ; self . events . push ( NetworkBehaviourAction :: SendEvent { peer_id : incoming . peer_id , event : CustomProtoHandlerIn :: Disable , } ) ; * state = PeerState :: Disabled { open : false , connected_point , banned_until : None } ; }
Function that is called when the peerset wants us to reject an incoming node.
Function that is called when the peerset wants us to reject an incoming node .
&mut self
index
substrate_peerset::IncomingIndex
&mut self
index
substrate_peerset::IncomingIndex