lnwire: Trim zero-bytes from NodeAlias String representation
This commit alters the NodeAlias String method to trim null-bytes from the end of the alias. This is helpful for presentation in contexts such as the GetInfo response.
This commit is contained in:
parent
f1f1c8a257
commit
ecff8f2a07
@ -40,7 +40,8 @@ func NewNodeAlias(s string) (NodeAlias, error) {
|
||||
|
||||
// String returns a utf8 string representation of the alias bytes.
|
||||
func (n NodeAlias) String() string {
|
||||
return string(n[:])
|
||||
// Trim trailing zero-bytes for presentation
|
||||
return string(bytes.Trim(n[:], "\x00"))
|
||||
}
|
||||
|
||||
// NodeAnnouncement message is used to announce the presence of a Lightning
|
||||
|
Loading…
Reference in New Issue
Block a user