Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Find the alive incoming entry on disconnect of an Incoming peer. #6320

Merged
merged 2 commits into from
Jun 11, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion client/network/src/protocol/generic_proto/behaviour.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1086,7 +1086,9 @@ impl NetworkBehaviour for GenericProto {
// In the incoming state, we don't report "Dropped". Instead we will just ignore the
// corresponding Accept/Reject.
Some(PeerState::Incoming { }) => {
if let Some(state) = self.incoming.iter_mut().find(|i| i.peer_id == *peer_id) {
if let Some(state) = self.incoming.iter_mut()
.find(|i| i.alive && i.peer_id == *peer_id)
{
debug!(target: "sub-libp2p",
"Libp2p => Disconnected({}): Was in incoming mode with id {:?}.",
peer_id, state.incoming_id);
Expand Down