浏览代码

added blank address check on peers

0xdcarns 3 年之前
父节点
当前提交
5aae277551
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      logic/peers.go

+ 2 - 2
logic/peers.go

@@ -93,10 +93,10 @@ func GetNodePeers(network *models.Network, nodeid string, excludeRelayed bool, i
 			if peer.IsIngressGateway == "yes" { // handle ingress stuff
 				if currentExtClients, err := GetExtPeersList(&node); err == nil {
 					for i := range currentExtClients {
-						if network.IsIPv4 == "yes" {
+						if network.IsIPv4 == "yes" && currentExtClients[i].Address != "" {
 							peer.AllowedIPs = append(peer.AllowedIPs, currentExtClients[i].Address)
 						}
-						if network.IsIPv6 == "yes" {
+						if network.IsIPv6 == "yes" && currentExtClients[i].Address6 != "" {
 							peer.AllowedIPs = append(peer.AllowedIPs, currentExtClients[i].Address6)
 						}
 					}