Skip to content

Commit

Permalink
rpc: adds opener and closer to listpeers channels
Browse files Browse the repository at this point in the history
Changelog-Added: RPC: Added 'opener' and 'closer' to listpeers channels
  • Loading branch information
m-schmoock authored and niftynei committed Nov 6, 2020
1 parent 083a856 commit b7c1851
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 4 deletions.
10 changes: 10 additions & 0 deletions lightningd/peer_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -802,6 +802,16 @@ static void json_add_channel(struct lightningd *ld,
response, "private",
!(channel->channel_flags & CHANNEL_FLAGS_ANNOUNCE_CHANNEL));

/* opener and closer */
assert(channel->opener != NUM_SIDES);
json_add_string(response, "opener", channel->opener == LOCAL ?
"local" : "remote");
if (channel->closer != NUM_SIDES)
json_add_string(response, "closer", channel->closer == LOCAL ?
"local" : "remote");
else
json_add_null(response, "closer");

json_array_start(response, "features");
if (channel->option_static_remotekey)
json_add_string(response, NULL, "option_static_remotekey");
Expand Down
2 changes: 1 addition & 1 deletion wallet/db_postgres_sqlgen.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion wallet/db_sqlite3_sqlgen.c

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions wallet/statements_gettextgen.po

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions wallet/test/run-wallet.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,9 @@ void json_add_node_id(struct json_stream *response UNNEEDED,
const char *fieldname UNNEEDED,
const struct node_id *id UNNEEDED)
{ fprintf(stderr, "json_add_node_id called!\n"); abort(); }
/* Generated stub for json_add_null */
void json_add_null(struct json_stream *stream UNNEEDED, const char *fieldname UNNEEDED)
{ fprintf(stderr, "json_add_null called!\n"); abort(); }
/* Generated stub for json_add_num */
void json_add_num(struct json_stream *result UNNEEDED, const char *fieldname UNNEEDED,
unsigned int value UNNEEDED)
Expand Down

0 comments on commit b7c1851

Please sign in to comment.