mirror of
https://github.com/PeernetOfficial/core.git
synced 2026-07-20 20:07:51 +01:00
Network detection proper action on IP new and remove. Close #2
This commit is contained in:
@@ -159,12 +159,16 @@ func networkPrepareListen(ipA string, port int) (network *Network, err error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
networksMutex.Lock()
|
||||
|
||||
// Success - port is open. Add to the list and start accepting incoming messages.
|
||||
if IsIPv4(ip) {
|
||||
networks4 = append(networks4, network)
|
||||
networksMutex.Unlock()
|
||||
network.BroadcastIPv4()
|
||||
} else {
|
||||
networks6 = append(networks6, network)
|
||||
networksMutex.Unlock()
|
||||
network.MulticastIPv6Join()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user