5
0
mirror of https://github.com/cwinfo/yggdrasil-go.git synced 2024-11-23 00:51:35 +00:00

Don't block on adding peers in case one is unreachable and we are forced to wait for timeout

This commit is contained in:
Neil Alexander 2019-07-06 12:12:30 +01:00
parent 02c99d3e7d
commit 618d46a7b3
No known key found for this signature in database
GPG Key ID: A02A2019A2BB0944

View File

@ -88,14 +88,14 @@ func (c *Core) addPeerLoop() {
// Add peers from the Peers section // Add peers from the Peers section
for _, peer := range current.Peers { for _, peer := range current.Peers {
c.AddPeer(peer, "") go c.AddPeer(peer, "")
time.Sleep(time.Second) time.Sleep(time.Second)
} }
// Add peers from the InterfacePeers section // Add peers from the InterfacePeers section
for intf, intfpeers := range current.InterfacePeers { for intf, intfpeers := range current.InterfacePeers {
for _, peer := range intfpeers { for _, peer := range intfpeers {
c.AddPeer(peer, intf) go c.AddPeer(peer, intf)
time.Sleep(time.Second) time.Sleep(time.Second)
} }
} }