Skip to content

Commit

Permalink
Assume input is deduped
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoPolo committed Apr 12, 2023
1 parent 18e56e9 commit 2c5b057
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion p2p/host/basic/basic_host.go
Expand Up @@ -998,9 +998,10 @@ func (h *BasicHost) AllAddrs() []ma.Multiaddr {
}
finalAddrs = append(finalAddrs, observedAddrs...)
}
finalAddrs = dedupAddrs(finalAddrs)
finalAddrs = inferWebtransportAddrsFromQuic(finalAddrs)

return dedupAddrs(finalAddrs)
return finalAddrs
}

var wtComponent = ma.StringCast("/webtransport")
Expand All @@ -1010,6 +1011,7 @@ var wtComponent = ma.StringCast("/webtransport")
// If we see that we are listening on the same port for QUIC and WebTransport,
// we can be pretty sure that the WebTransport addr will be reachable if the
// QUIC one is.
// We assume the input is deduped.
func inferWebtransportAddrsFromQuic(in []ma.Multiaddr) []ma.Multiaddr {
// We need to check if we are listening on the same ip+port for QUIC and WebTransport.
// If not, there's nothing to do since we can't infer anything.
Expand Down

0 comments on commit 2c5b057

Please sign in to comment.