check for nil Alias

This commit is contained in:
Roei Erez
2023-12-07 07:32:16 +02:00
parent 628849a6ad
commit 83364f906f

View File

@@ -247,8 +247,8 @@ func (c *ClnClient) GetPeerId(scid *lightning.ShortChannelID) ([]byte, error) {
var dest *string
for _, ch := range channels {
if ch.Alias.Local == scidStr ||
ch.Alias.Remote == scidStr ||
if (ch.Alias != nil && (ch.Alias.Local == scidStr ||
ch.Alias.Remote == scidStr)) ||
ch.ShortChannelId == scidStr {
dest = &ch.PeerId
break