diff --git a/libp2p/switch.nim b/libp2p/switch.nim index dfb2e9f..23e1204 100644 --- a/libp2p/switch.nim +++ b/libp2p/switch.nim @@ -220,6 +220,10 @@ proc upgradeOutgoing(s: Switch, conn: Connection): Future[Connection] {.async, g trace "upgrading connection" let muxer = await s.mux(sconn) # mux it if possible + if muxer == nil: + # TODO this might be relaxed in the future + raise newException(CatchableError, + "a muxer is required for outgoing connections") await s.identify(muxer)