diff --git a/p2p/host/relay/autorelay.go b/p2p/host/relay/autorelay.go index 8d8302da3..f506a0baa 100644 --- a/p2p/host/relay/autorelay.go +++ b/p2p/host/relay/autorelay.go @@ -20,6 +20,10 @@ import ( manet "github.com/multiformats/go-multiaddr-net" ) +const ( + RelayRenezvous = "/libp2p/relay" +) + var ( DesiredRelays = 3 @@ -121,7 +125,7 @@ func (h *AutoRelayHost) findRelays(ctx context.Context) { } dctx, cancel := context.WithTimeout(ctx, 60*time.Second) - pis, err := discovery.FindPeers(dctx, h.discover, "/libp2p/relay", limit) + pis, err := discovery.FindPeers(dctx, h.discover, RelayRenezvous, limit) cancel() if err != nil { log.Debugf("error discovering relays: %s", err.Error()) diff --git a/p2p/host/relay/relay.go b/p2p/host/relay/relay.go index 17aa09cd4..8ba99d5ed 100644 --- a/p2p/host/relay/relay.go +++ b/p2p/host/relay/relay.go @@ -25,7 +25,7 @@ func NewRelayHost(ctx context.Context, bhost *basic.BasicHost, advertise discove advertise: advertise, } bhost.AddrsFactory = h.hostAddrs - discovery.Advertise(ctx, advertise, "/libp2p/relay") + discovery.Advertise(ctx, advertise, RelayRenezvous) return h }