Skip to content

Commit

Permalink
basichost: remove invalid comment
Browse files Browse the repository at this point in the history
This was copied from RoutedHost.NewStream. It is only relevant for
RoutedHost
  • Loading branch information
sukunrt committed Jul 17, 2023
1 parent 636a096 commit 8851e4b
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions p2p/host/basic/basic_host.go
Original file line number Diff line number Diff line change
Expand Up @@ -629,9 +629,6 @@ func (h *BasicHost) RemoveStreamHandler(pid protocol.ID) {
// to create one. If ProtocolID is "", writes no header.
// (Thread-safe)
func (h *BasicHost) NewStream(ctx context.Context, p peer.ID, pids ...protocol.ID) (network.Stream, error) {
// Ensure we have a connection, with peer addresses resolved by the routing system (#207)
// It is not sufficient to let the underlying host connect, it will most likely not have
// any addresses for the peer without any prior connections.
// If the caller wants to prevent the host from dialing, it should use the NoDial option.
if nodial, _ := network.GetNoDial(ctx); !nodial {
err := h.Connect(ctx, peer.AddrInfo{ID: p})
Expand Down

0 comments on commit 8851e4b

Please sign in to comment.