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

Commit

Permalink
Do not prematurely emit CustomProtocolClosed on connection close. (#5595
Browse files Browse the repository at this point in the history
)
  • Loading branch information
romanb authored Apr 9, 2020
1 parent 79809a6 commit c960f10
Showing 1 changed file with 1 addition and 1 deletion.
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

0 comments on commit c960f10

Please sign in to comment.