diff --git a/libp2p/transports/tcptransport.nim b/libp2p/transports/tcptransport.nim index 998d04337..46aa0a259 100644 --- a/libp2p/transports/tcptransport.nim +++ b/libp2p/transports/tcptransport.nim @@ -130,13 +130,18 @@ proc new*( flags: set[ServerFlags] = {}, upgrade: Upgrade): T {.public.} = - let transport = T( - flags: flags, - clientFlags: - if ServerFlags.TcpNoDelay in flags: - {TransportFlags.TcpNoDelay} - else: - default(set[TransportFlags]), + let + transport = T( + flags: flags, + clientFlags: + if ServerFlags.TcpNoDelay in flags: + compilesOr: + {TransportFlags.TcpNoDelay} + do: + doAssert(false) + default(set[TransportFlags]) + else: + default(set[TransportFlags]), upgrader: upgrade) return transport