From 28b3e443440933a98a64f7be9ad2e58d018c5ea6 Mon Sep 17 00:00:00 2001 From: Yilun Date: Tue, 19 Nov 2024 07:50:32 -0800 Subject: [PATCH] check channel close in listenNKN Signed-off-by: Yilun --- client.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/client.go b/client.go index c98148c..bcf49cf 100644 --- a/client.go +++ b/client.go @@ -359,7 +359,10 @@ func (c *TunaSessionClient) GetPubAddrs() *PubAddrs { func (c *TunaSessionClient) listenNKN() { for { - msg := <-c.multiClient.OnMessage.C + msg, ok := <-c.multiClient.OnMessage.C + if !ok { + return + } if !c.shouldAcceptAddr(msg.Src) { continue }