correct remote alias

This commit is contained in:
callebtc
2022-07-08 21:44:44 +02:00
parent 03e600a2bf
commit 9e88be215f
4 changed files with 80 additions and 48 deletions

View File

@@ -8,7 +8,11 @@ import (
)
func trimPubKey(pubkey []byte) string {
return fmt.Sprintf("%s...%s", hex.EncodeToString(pubkey)[:6], hex.EncodeToString(pubkey)[len(hex.EncodeToString(pubkey))-6:])
if len(pubkey) > 12 {
return fmt.Sprintf("%s...%s", hex.EncodeToString(pubkey)[:6], hex.EncodeToString(pubkey)[len(hex.EncodeToString(pubkey))-6:])
} else {
return hex.EncodeToString(pubkey)
}
}
func welcome() {