diff --git a/pkg/node/peer.go b/pkg/node/peer.go index 85335aa..a8801a1 100644 --- a/pkg/node/peer.go +++ b/pkg/node/peer.go @@ -56,7 +56,8 @@ const ( // peerNameRegex validates peer names: alphanumeric, hyphens, underscores, and spaces var peerNameRegex = regexp.MustCompile(`^[a-zA-Z0-9][a-zA-Z0-9\-_ ]{0,62}[a-zA-Z0-9]$|^[a-zA-Z0-9]$`) -// safeKeyPrefix returns a truncated key for logging, handling short keys safely +// safeKeyPrefix("abc123def456xyz789") // "abc123def456xyz7..." +// safeKeyPrefix("") // "(empty)" func safeKeyPrefix(key string) string { if len(key) >= 16 { return key[:16] + "..."