Ver Fonte

set peer endpoint if host endpoint is nil

abhishek9686 há 10 meses atrás
pai
commit
dc03269771
1 ficheiros alterados com 2 adições e 2 exclusões
  1. 2 2
      logic/peers.go

+ 2 - 2
logic/peers.go

@@ -227,12 +227,12 @@ func GetPeerUpdateForHost(network string, host *models.Host, allNodes []models.N
 			} else if host.EndpointIPv6 != nil && peerHost.EndpointIPv6 != nil {
 				peerEndpoint = peerHost.EndpointIPv6
 			}
-			if host.EndpointIP == nil {
+			if host.EndpointIP == nil && peerEndpoint == nil {
 				if peerHost.EndpointIP != nil {
 					peerEndpoint = peerHost.EndpointIP
 				}
 			}
-			if host.EndpointIP == nil && peerEndpoint == nil {
+			if host.EndpointIPv6 == nil && peerEndpoint == nil {
 				if peerHost.EndpointIPv6 != nil {
 					peerEndpoint = peerHost.EndpointIPv6
 				}