From 2398ba4fac78b0fc25ea80c38f77575928ebbca8 Mon Sep 17 00:00:00 2001 From: Jorropo Date: Wed, 16 Aug 2023 18:24:41 +0200 Subject: [PATCH] cleanup: add continue in case of failure in the (*BasicHost).Addrs certhash loop (#2492) This does not do change anything because the transport always returns the same multiaddr you passed in in case of failure, it just looks wrong and relies on a obscure detail of the webtransport's AddCertHashes function, while this does not. --- p2p/host/basic/basic_host.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/p2p/host/basic/basic_host.go b/p2p/host/basic/basic_host.go index 1f440fd946..71ad396768 100644 --- a/p2p/host/basic/basic_host.go +++ b/p2p/host/basic/basic_host.go @@ -792,10 +792,11 @@ func (h *BasicHost) Addrs() []ma.Multiaddr { continue } addrWithCerthash, added := tpt.AddCertHashes(addr) - addrs[i] = addrWithCerthash if !added { log.Debug("Couldn't add certhashes to webtransport multiaddr because we aren't listening on webtransport") + continue } + addrs[i] = addrWithCerthash } } return addrs