return empty string if scid is nil

This commit is contained in:
Jesse de Wit
2023-12-29 12:59:24 +01:00
parent 8bf903d167
commit 8f59984bfb

View File

@@ -43,6 +43,9 @@ func NewShortChannelIDFromString(channelID string) (*ShortChannelID, error) {
}
func (c *ShortChannelID) ToString() string {
if c == nil {
return ""
}
u := uint64(*c)
blockHeight := (u >> 40) & 0xFFFFFF
txIndex := (u >> 16) & 0xFFFFFF