Browse Source

rpc: adds opener and closer to listpeers channels

Changelog-Added: RPC: Added 'opener' and 'closer' to listpeers channels
ppa-prep
Michael Schmoock 4 years ago
committed by neil saitug
parent
commit
b7c18517df
  1. 10
      lightningd/peer_control.c
  2. 2
      wallet/db_postgres_sqlgen.c
  3. 2
      wallet/db_sqlite3_sqlgen.c
  4. 4
      wallet/statements_gettextgen.po
  5. 3
      wallet/test/run-wallet.c

10
lightningd/peer_control.c

@ -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");

2
wallet/db_postgres_sqlgen.c

@ -1672,4 +1672,4 @@ struct db_query db_postgres_queries[] = {
#endif /* LIGHTNINGD_WALLET_GEN_DB_POSTGRES */
// SHA256STAMP:6a3645b429a4a9b7906003179a77361d5c46fc7690c895429c1b3cac72acfd92
// SHA256STAMP:e101a44fa0daaa4c1118759cc19d3b1b31dedfe85cf0cf3502bd41f939e55634

2
wallet/db_sqlite3_sqlgen.c

@ -1672,4 +1672,4 @@ struct db_query db_sqlite3_queries[] = {
#endif /* LIGHTNINGD_WALLET_GEN_DB_SQLITE3 */
// SHA256STAMP:6a3645b429a4a9b7906003179a77361d5c46fc7690c895429c1b3cac72acfd92
// SHA256STAMP:e101a44fa0daaa4c1118759cc19d3b1b31dedfe85cf0cf3502bd41f939e55634

4
wallet/statements_gettextgen.po

@ -1098,7 +1098,7 @@ msgstr ""
msgid "not a valid SQL statement"
msgstr ""
#: wallet/test/run-wallet.c:1367
#: wallet/test/run-wallet.c:1370
msgid "INSERT INTO channels (id) VALUES (1);"
msgstr ""
# SHA256STAMP:dc49fb9d8f77f85e9ca780fbb5dc1f9f764fb66653a929fd57d225115dc93bf6
# SHA256STAMP:0c250c26e1bcb07604d3665155ac7b6edd68904f0cb536b8ccbd0191582d75d5

3
wallet/test/run-wallet.c

@ -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)

Loading…
Cancel
Save