plugins/topology: add direction field to listchannels.

It's a core concept in the spec which isn't directly exposed.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: JSON-RPC: `listchannels` added a `direction` field (0 or 1) as per gossip specification.
This commit is contained in:
Rusty Russell
2023-01-30 16:37:03 +10:30
committed by Alex Myers
parent 611795beee
commit 9ab488fc41
9 changed files with 21 additions and 1 deletions

View File

@@ -244,6 +244,7 @@ static void json_add_halfchan(struct json_stream *response,
json_add_node_id(response, "source", &node_id[dir]);
json_add_node_id(response, "destination", &node_id[!dir]);
json_add_short_channel_id(response, "short_channel_id", &scid);
json_add_num(response, "direction", dir);
json_add_bool(response, "public", !c->private);
gossmap_chan_get_update_details(gossmap, c, dir,