diff --git a/src/protocol/notification/mod.rs b/src/protocol/notification/mod.rs index 42063081..33108d3f 100644 --- a/src/protocol/notification/mod.rs +++ b/src/protocol/notification/mod.rs @@ -258,7 +258,7 @@ pub(crate) struct NotificationProtocol { /// Connected peers. peers: HashMap, - /// Pending outboudn substreams. + /// Pending outbound substreams. pending_outbound: HashMap, /// Handshaking service which reads and writes the handshakes to inbound @@ -384,6 +384,8 @@ impl NotificationProtocol { async fn on_connection_closed(&mut self, peer: PeerId) -> crate::Result<()> { tracing::trace!(target: LOG_TARGET, ?peer, protocol = %self.protocol, "connection closed"); + self.pending_outbound.retain(|_, p| p != &peer); + let Some(context) = self.peers.remove(&peer) else { tracing::error!( target: LOG_TARGET,