From fcca194c8d14c46ad25c2e7bf678144323729613 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Papp?= Date: Thu, 27 Feb 2025 12:34:18 +0100 Subject: [PATCH] Fix close --- client/internal/conn_mgr.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/internal/conn_mgr.go b/client/internal/conn_mgr.go index ed6fbf01b..aae6153bc 100644 --- a/client/internal/conn_mgr.go +++ b/client/internal/conn_mgr.go @@ -122,14 +122,16 @@ func (e *ConnMgr) Close() { } // todo wait for receiveLazyConnEvents to finish e.lazyConnMgr.Close() + e.lazyConnMgr = nil } func (e *ConnMgr) receiveLazyConnEvents(ctx context.Context) { for { select { + case <-ctx.Done(): + return case peerID := <-e.lazyConnMgr.PeerActivityChan: e.peerStore.PeerConnOpen(peerID) - case <-ctx.Done(): } } }