diff --git a/libp2p/muxers/mplex/mplex.nim b/libp2p/muxers/mplex/mplex.nim index ab8889d..bf62fd0 100644 --- a/libp2p/muxers/mplex/mplex.nim +++ b/libp2p/muxers/mplex/mplex.nim @@ -118,6 +118,7 @@ method handle*(m: Mplex) {.async, gcsafe.} = # doAssert(stream.closed, "connection not closed by handler!") except CatchableError as exc: trace "exception in stream handler", exc = exc.msg + doAssert(stream.closed, "stream not closed by protocol handler") finally: m.conns.keepItIf(it != stream) m.handlerFuts.keepItIf(it != fut) diff --git a/libp2p/protocols/pubsub/gossipsub.nim b/libp2p/protocols/pubsub/gossipsub.nim index a6ed0df..e68d50d 100644 --- a/libp2p/protocols/pubsub/gossipsub.nim +++ b/libp2p/protocols/pubsub/gossipsub.nim @@ -215,7 +215,7 @@ proc heartbeat(g: GossipSub) {.async.} = await g.heartbeatLock.acquire() trace "running heartbeat" - for t in g.topics.keys: + for t in toSeq(g.topics.keys): await g.rebalanceMesh(t) await g.dropFanoutPeers()