mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-20 23:54:22 +01:00
jsonrpc: Include the direction also if we have an alias
The direction only depends on the ordering between node_ids, not the short_channel_id, so we can include it and it won't change. This was causing some trouble loading the `channel_hints` in the `pay` plugin.
This commit is contained in:
@@ -1603,14 +1603,19 @@ static struct listpeers_channel *json_to_listpeers_channel(const tal_t *ctx,
|
||||
if (scidtok != NULL) {
|
||||
assert(dirtok != NULL);
|
||||
chan->scid = tal(chan, struct short_channel_id);
|
||||
chan->direction = tal(chan, int);
|
||||
json_to_short_channel_id(buffer, scidtok, chan->scid);
|
||||
json_to_int(buffer, dirtok, chan->direction);
|
||||
}else {
|
||||
assert(dirtok == NULL);
|
||||
} else {
|
||||
chan->scid = NULL;
|
||||
chan->direction = NULL;
|
||||
}
|
||||
|
||||
if (dirtok != NULL) {
|
||||
chan->direction = tal(chan, int);
|
||||
json_to_int(buffer, dirtok, chan->direction);
|
||||
} else {
|
||||
chan->direction = NULL;
|
||||
}
|
||||
|
||||
if (aliastok != NULL) {
|
||||
const jsmntok_t *loctok =
|
||||
json_get_member(buffer, aliastok, "local"),
|
||||
|
||||
Reference in New Issue
Block a user