Skip to content
Snippets Groups Projects
Commit 40c56dee authored by Roman Borschel's avatar Roman Borschel Committed by GitHub
Browse files

Do not prematurely emit CustomProtocolClosed on connection close. (#5595)

parent 7da99521
No related merge requests found
......@@ -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(),
......
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