mirror of
https://github.com/cwinfo/yggdrasil-go.git
synced 2024-11-13 00:30:28 +00:00
Goroutines in _addPeerLoop from bugfixes
This commit is contained in:
parent
5a382e7e0b
commit
7b1678a11d
@ -92,17 +92,21 @@ 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 {
|
||||||
if err := c.CallPeer(peer, ""); err != nil {
|
go func(peer, intf string) {
|
||||||
c.log.Errorln("Failed to add peer:", err)
|
if err := c.CallPeer(peer, intf); err != nil {
|
||||||
}
|
c.log.Errorln("Failed to add peer:", err)
|
||||||
|
}
|
||||||
|
}(peer, "")
|
||||||
}
|
}
|
||||||
|
|
||||||
// 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 {
|
||||||
if err := c.CallPeer(peer, intf); err != nil {
|
go func(peer, intf string) {
|
||||||
c.log.Errorln("Failed to add peer:", err)
|
if err := c.CallPeer(peer, intf); err != nil {
|
||||||
}
|
c.log.Errorln("Failed to add peer:", err)
|
||||||
|
}
|
||||||
|
}(peer, intf)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user