From 45a3427add31c3a879ddc802eca96a4c1cf06a4b Mon Sep 17 00:00:00 2001 From: Yiannis Marangos Date: Wed, 18 Oct 2023 13:44:52 +0300 Subject: [PATCH] fix(p2p): Start listening to QUIC when CELESTIA_ENABLE_QUIC is set --- nodebuilder/p2p/addrs.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/nodebuilder/p2p/addrs.go b/nodebuilder/p2p/addrs.go index 528f58d722..27fbd244a3 100644 --- a/nodebuilder/p2p/addrs.go +++ b/nodebuilder/p2p/addrs.go @@ -19,11 +19,13 @@ func Listen(listen []string) func(h hst.Host) (err error) { return fmt.Errorf("failure to parse config.P2P.ListenAddresses: %s", err) } - // TODO(@WonderTan): Remove this check when QUIC is stable - if slices.ContainsFunc(maddr.Protocols(), func(p ma.Protocol) bool { - return p.Code == ma.P_QUIC_V1 || p.Code == ma.P_WEBTRANSPORT - }) { - continue + if !enableQUIC { + // TODO(@WonderTan): Remove this check when QUIC is stable + if slices.ContainsFunc(maddr.Protocols(), func(p ma.Protocol) bool { + return p.Code == ma.P_QUIC_V1 || p.Code == ma.P_WEBTRANSPORT + }) { + continue + } } maListen = append(maListen, maddr)