From b30b2656d52ee304bd56f8f8bbf59ab82b658a36 Mon Sep 17 00:00:00 2001 From: Ivan FB <128452529+Ivansete-status@users.noreply.github.com> Date: Wed, 17 Apr 2024 22:44:41 +0200 Subject: [PATCH] fix: reset accept fut in stop (#1082) Co-authored-by: diegomrsantos --- libp2p/transports/tcptransport.nim | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libp2p/transports/tcptransport.nim b/libp2p/transports/tcptransport.nim index 0241ec8da..a8b536e48 100644 --- a/libp2p/transports/tcptransport.nim +++ b/libp2p/transports/tcptransport.nim @@ -190,6 +190,7 @@ method stop*(self: TcpTransport) {.async.} = await allFutures(toWait) self.servers = @[] + self.acceptFuts = @[] trace "Transport stopped" untrackCounter(TcpTransportTrackerName) @@ -221,6 +222,7 @@ method accept*(self: TcpTransport): Future[Connection] {.async.} = let observedAddr = MultiAddress.init(transp.remoteAddress).tryGet() return await self.connHandler(transp, Opt.some(observedAddr), Direction.In) except CancelledError as exc: + debug "CancelledError", exc = exc.msg transp.close() raise exc except CatchableError as exc: