Skip to content

Commit b30b265

Browse files
fix: reset accept fut in stop (#1082)
Co-authored-by: diegomrsantos <diego@status.im>
1 parent 89cad5a commit b30b265

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

libp2p/transports/tcptransport.nim

+2
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ method stop*(self: TcpTransport) {.async.} =
190190
await allFutures(toWait)
191191

192192
self.servers = @[]
193+
self.acceptFuts = @[]
193194

194195
trace "Transport stopped"
195196
untrackCounter(TcpTransportTrackerName)
@@ -221,6 +222,7 @@ method accept*(self: TcpTransport): Future[Connection] {.async.} =
221222
let observedAddr = MultiAddress.init(transp.remoteAddress).tryGet()
222223
return await self.connHandler(transp, Opt.some(observedAddr), Direction.In)
223224
except CancelledError as exc:
225+
debug "CancelledError", exc = exc.msg
224226
transp.close()
225227
raise exc
226228
except CatchableError as exc:

0 commit comments

Comments
 (0)