mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-18 18:45:41 +00:00
Do not prematurely emit CustomProtocolClosed on connection close. (#5595)
This commit is contained in:
@@ -914,7 +914,7 @@ impl NetworkBehaviour for GenericProto {
|
|||||||
// in which case `CustomProtocolClosed` was already emitted.
|
// in which case `CustomProtocolClosed` was already emitted.
|
||||||
let closed = open.is_empty();
|
let closed = open.is_empty();
|
||||||
open.retain(|c| c != conn);
|
open.retain(|c| c != conn);
|
||||||
if !closed {
|
if open.is_empty() && !closed {
|
||||||
debug!(target: "sub-libp2p", "External API <= Closed({})", peer_id);
|
debug!(target: "sub-libp2p", "External API <= Closed({})", peer_id);
|
||||||
let event = GenericProtoOut::CustomProtocolClosed {
|
let event = GenericProtoOut::CustomProtocolClosed {
|
||||||
peer_id: peer_id.clone(),
|
peer_id: peer_id.clone(),
|
||||||
|
|||||||
Reference in New Issue
Block a user