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 fd3ed65 commit f640d2d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion p2p/host/basic/basic_host.go
Original file line number Diff line number Diff line change
Expand Up @@ -1006,9 +1006,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 @@ -1018,6 +1019,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 f640d2d

Please sign in to comment.