Commit 9795a01b authored by vyzo's avatar vyzo
Browse files

configurable boot delay for autorelay

parent a5858912
...@@ -19,7 +19,11 @@ import ( ...@@ -19,7 +19,11 @@ import (
manet "github.com/multiformats/go-multiaddr-net" 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. // AutoRelayHost is a Host that uses relays for connectivity when a NAT is detected.
type AutoRelayHost struct { type AutoRelayHost struct {
...@@ -63,7 +67,7 @@ func (h *AutoRelayHost) hostAddrs(addrs []ma.Multiaddr) []ma.Multiaddr { ...@@ -63,7 +67,7 @@ func (h *AutoRelayHost) hostAddrs(addrs []ma.Multiaddr) []ma.Multiaddr {
func (h *AutoRelayHost) background(ctx context.Context) { func (h *AutoRelayHost) background(ctx context.Context) {
select { select {
case <-time.After(autonat.AutoNATBootDelay + 30*time.Second): case <-time.After(autonat.AutoNATBootDelay + BootDelay):
case <-ctx.Done(): case <-ctx.Done():
return return
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment