fix: add back check on missing namespace in MakeEndpointNodeIDB()

This commit is contained in:
Bryan Boreham
2019-09-27 15:08:31 +00:00
parent cbbb2ff24c
commit 7b4fa141d3

View File

@@ -36,7 +36,10 @@ func MakeEndpointNodeID(hostID, namespaceID, address, port string) string {
// MakeEndpointNodeIDB produces an endpoint node ID from its composite parts in binary, not strings.
func MakeEndpointNodeIDB(hostID string, namespaceID uint64, addressIP net.IP, port uint16) string {
namespace := strconv.FormatUint(namespaceID, 10)
namespace := ""
if namespaceID > 0 {
namespace = strconv.FormatUint(namespaceID, 10)
}
return makeAddressID(hostID, namespace, addressIP.String(), addressIP) + ScopeDelim + strconv.Itoa(int(port))
}