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

Commit c960f10

Browse files
authored
Do not prematurely emit CustomProtocolClosed on connection close. (#5595)
1 parent 79809a6 commit c960f10

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

client/network/src/protocol/generic_proto/behaviour.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -914,7 +914,7 @@ impl NetworkBehaviour for GenericProto {
914914
// in which case `CustomProtocolClosed` was already emitted.
915915
let closed = open.is_empty();
916916
open.retain(|c| c != conn);
917-
if !closed {
917+
if open.is_empty() && !closed {
918918
debug!(target: "sub-libp2p", "External API <= Closed({})", peer_id);
919919
let event = GenericProtoOut::CustomProtocolClosed {
920920
peer_id: peer_id.clone(),

0 commit comments

Comments
 (0)