Skip to content
Snippets Groups Projects
Commit 4fe70ee6 authored by Pierre Krieger's avatar Pierre Krieger Committed by Gav Wood
Browse files

Forgot to handle Banned in inject_connected (#2107)

* Forgot to handle Banned in inject_connected

* Also add debug for the state
parent c6addc9b
No related merge requests found
......@@ -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
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment