From 4fe70ee6390f433db3fb1fe1e5f4f64dab7b0b18 Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Mon, 25 Mar 2019 14:48:43 +0100 Subject: [PATCH] Forgot to handle Banned in inject_connected (#2107) * Forgot to handle Banned in inject_connected * Also add debug for the state --- substrate/core/network-libp2p/src/custom_proto/behaviour.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/substrate/core/network-libp2p/src/custom_proto/behaviour.rs b/substrate/core/network-libp2p/src/custom_proto/behaviour.rs index 796ff32af1..fa5b1a3b72 100644 --- a/substrate/core/network-libp2p/src/custom_proto/behaviour.rs +++ b/substrate/core/network-libp2p/src/custom_proto/behaviour.rs @@ -571,7 +571,8 @@ where match (self.peers.entry(peer_id), connected_point) { (Entry::Occupied(mut entry), connected_point) => { match mem::replace(entry.get_mut(), PeerState::Poisoned) { - PeerState::Requested | PeerState::PendingRequest { .. } => { + PeerState::Requested | PeerState::PendingRequest { .. } | + PeerState::Banned { .. } => { debug!(target: "sub-libp2p", "Libp2p => Connected({:?}): Connection \ requested by PSM (through {:?})", entry.key(), connected_point); debug!(target: "sub-libp2p", "Handler({:?}) <= Enable", entry.key()); @@ -584,7 +585,7 @@ where st @ _ => { // This is a serious bug either in this state machine or in libp2p. error!(target: "sub-libp2p", "Received inject_connected for \ - already-connected node"); + already-connected node; state is {:?}", st); *entry.into_mut() = st; return }