Skip to content
Snippets Groups Projects
Commit b6c54b5c authored by Pierre Krieger's avatar Pierre Krieger Committed by Arkadiy Paronyan
Browse files

Always accept incoming connections (#2101)

parent a1f3b0b5
No related merge requests found
......@@ -563,7 +563,7 @@ 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::Requested | PeerState::PendingRequest { .. } => {
debug!(target: "sub-libp2p", "Libp2p => Connected({:?}): Connection \
requested by PSM (through {:?})", entry.key(), connected_point);
debug!(target: "sub-libp2p", "Handler({:?}) <= Enable", entry.key());
......@@ -573,21 +573,6 @@ where
});
*entry.into_mut() = PeerState::Enabled { open: false, connected_point };
}
PeerState::PendingRequest { timer } => {
debug!(target: "sub-libp2p", "Libp2p => Connected({:?}): Connection \
requested by PSM (through {:?}) but node is banned", entry.key(),
connected_point);
debug!(target: "sub-libp2p", "Handler({:?}) <= Disable", entry.key());
self.events.push(NetworkBehaviourAction::SendEvent {
peer_id: entry.key().clone(),
event: CustomProtoHandlerIn::Disable,
});
*entry.into_mut() = PeerState::DisabledPendingEnable {
open: false,
connected_point,
timer,
};
}
st @ _ => {
// This is a serious bug either in this state machine or in libp2p.
error!(target: "sub-libp2p", "Received inject_connected for \
......
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