Browse Source

configurable boot delay for autorelay

pull/454/head
vyzo 6 years ago
parent
commit
9795a01ba3
  1. 8
      p2p/host/relay/autorelay.go

8
p2p/host/relay/autorelay.go

@ -19,7 +19,11 @@ import (
manet "github.com/multiformats/go-multiaddr-net"
)
var DesiredRelays = 3
var (
DesiredRelays = 3
BootDelay = 90 * time.Second
)
// AutoRelayHost is a Host that uses relays for connectivity when a NAT is detected.
type AutoRelayHost struct {
@ -63,7 +67,7 @@ func (h *AutoRelayHost) hostAddrs(addrs []ma.Multiaddr) []ma.Multiaddr {
func (h *AutoRelayHost) background(ctx context.Context) {
select {
case <-time.After(autonat.AutoNATBootDelay + 30*time.Second):
case <-time.After(autonat.AutoNATBootDelay + BootDelay):
case <-ctx.Done():
return
}

Loading…
Cancel
Save