removing peer cache

This commit is contained in:
afeiszli
2022-02-02 00:02:36 -05:00
parent 7c4e8b2b4a
commit 03a30b6bbc
7 changed files with 54 additions and 8 deletions

View File

@@ -69,6 +69,11 @@ func JoinNetwork(cfg config.ClientConfig, privateKey string) error {
if cfg.Node.LocalRange != "" && cfg.Node.LocalAddress == "" {
log.Println("local vpn, getting local address from range: " + cfg.Node.LocalRange)
cfg.Node.LocalAddress = getLocalIP(cfg.Node)
} else if cfg.Node.LocalAddress == "" {
intIP, err := getPrivateAddr()
if err == nil {
cfg.Node.LocalAddress = intIP
}
}
// set endpoint if blank. set to local if local net, retrieve from function if not
@@ -233,6 +238,8 @@ func JoinNetwork(cfg config.ClientConfig, privateKey string) error {
}
if err != nil {
return err
} else {
daemon.Restart()
}
return err