增加本地节点Hash辅助判断信息

This commit is contained in:
wyx2685 committed 2024-02-06 20:26:30 +09:00
1 parent 0d274bcf61
commit 73f9b19222
3 files changed
+16 -7

No files matched your search

-2
View File
@@ -307,10 +307,8 @@ func extractPortFromAddr(addr string) int {
}
func formatAddress(ip string, port int) string {
// 检查 IP 地址是否为 IPv6
if strings.Contains(ip, ":") {
return fmt.Sprintf("[%s]:%d", ip, port)
}
// 对于 IPv4 地址,直接返回 IP:Port 格式
return fmt.Sprintf("%s:%d", ip, port)
}