Browse Source

basichost: remove invalid comment (#2435)

pull/2439/head
Sukun 1 year ago
committed by GitHub
parent
commit
260b9695ca
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      p2p/host/basic/basic_host.go

3
p2p/host/basic/basic_host.go

@ -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})

Loading…
Cancel
Save