jsonrpc: Add aliases to listpeers result

This commit is contained in:
Christian Decker
2022-04-27 14:08:21 +02:00
parent 5e74048508
commit cdedd433a4
6 changed files with 52 additions and 1 deletions

View File

@@ -744,6 +744,17 @@ static void json_add_channel(struct lightningd *ld,
json_add_string(response, "closer", channel->closer == LOCAL ?
"local" : "remote");
if (channel->alias[LOCAL] || channel->alias[REMOTE]) {
json_object_start(response, "alias");
if (channel->alias[LOCAL])
json_add_short_channel_id(response, "local",
channel->alias[LOCAL]);
if (channel->alias[REMOTE])
json_add_short_channel_id(response, "remote",
channel->alias[REMOTE]);
json_object_end(response);
}
json_array_start(response, "features");
if (channel_has(channel, OPT_STATIC_REMOTEKEY))
json_add_string(response, NULL, "option_static_remotekey");