libplugin: don't return unopened channels from json_to_listpeers_channels().

This way we always have an SCID and a direction.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2023-01-12 11:49:10 +10:30
parent 57dcf68c0b
commit 5d5b9c6812
3 changed files with 11 additions and 11 deletions

View File

@@ -3302,11 +3302,10 @@ static struct command_result *direct_pay_listpeers(struct command *cmd,
d->chan = tal(d, struct short_channel_id_dir);
if (chan->scid) {
d->chan->scid = *chan->scid;
d->chan->dir = *chan->direction;
} else {
d->chan->scid = *chan->alias[LOCAL];
d->chan->dir = 0; /* Don't care. */
}
d->chan->dir = chan->direction;
}
direct_pay_override(p);