Shorten peer public key in connection logs

This commit is contained in:
Zoltan Papp
2025-08-05 00:28:56 +02:00
parent beb66208a0
commit f396277f91
2 changed files with 6 additions and 1 deletions

View File

@@ -127,7 +127,7 @@ func NewConn(config ConnConfig, services ServiceDependencies) (*Conn, error) {
return nil, fmt.Errorf("allowed IPs is empty")
}
connLog := log.WithField("peer", config.Key)
connLog := log.WithField("peer", shortenKey(config.Key))
var conn = &Conn{
Log: connLog,

View File

@@ -0,0 +1,5 @@
package peer
func shortenKey(pubKey string) string {
return pubKey[:7]
}