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

Do not prematurely emit CustomProtocolClosed on connection close. #5595

Merged
merged 1 commit into from
Apr 9, 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
2 changes: 1 addition & 1 deletion client/network/src/protocol/generic_proto/behaviour.rs
Original file line number Diff line number Diff line change
Expand Up @@ -914,7 +914,7 @@ impl NetworkBehaviour for GenericProto {
// in which case `CustomProtocolClosed` was already emitted.
let closed = open.is_empty();
open.retain(|c| c != conn);
if !closed {
if open.is_empty() && !closed {
debug!(target: "sub-libp2p", "External API <= Closed({})", peer_id);
let event = GenericProtoOut::CustomProtocolClosed {
peer_id: peer_id.clone(),
Expand Down