mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-06-16 22:25:08 +03:00
Avoid sending unnecessairy udp key packets, and try config peers less often
This commit is contained in:
parent
c3e236b7fb
commit
82fd435211
2 changed files with 8 additions and 4 deletions
|
@ -60,9 +60,10 @@ func (n *node) init(cfg *nodeConfig, logger *log.Logger) {
|
|||
if len(cfg.Peers) == 0 { return }
|
||||
for {
|
||||
for _, p := range cfg.Peers {
|
||||
n.core.DEBUG_sendUDPKeys(p)
|
||||
n.core.DEBUG_maybeSendUDPKeys(p)
|
||||
time.Sleep(time.Second)
|
||||
}
|
||||
time.Sleep(time.Minute)
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
@ -112,7 +113,7 @@ func (n *node) listen() {
|
|||
saddr := addr.String()
|
||||
//if _, isIn := n.peers[saddr]; isIn { continue }
|
||||
//n.peers[saddr] = struct{}{}
|
||||
n.core.DEBUG_sendUDPKeys(saddr)
|
||||
n.core.DEBUG_maybeSendUDPKeys(saddr)
|
||||
//fmt.Println("DEBUG:", "added multicast peer:", saddr)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue