listpeers: display billboard as 'status' array.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2018-02-23 16:23:47 +10:30 committed by Christian Decker
parent d4a172e221
commit 8aa7a48138
2 changed files with 19 additions and 0 deletions

View File

@ -130,6 +130,11 @@ void json_add_uncommitted_channel(struct json_result *response,
json_add_string(response, "owner", "lightning_openingd");
json_add_string(response, "funder",
uc->fc ? "LOCAL" : "REMOTE");
if (uc->transient_billboard) {
json_array_start(response, "status");
json_add_string(response, NULL, uc->transient_billboard);
json_array_end(response);
}
if (uc->fc) {
u64 msatoshi_total, our_msatoshi;

View File

@ -4,6 +4,7 @@
#include <arpa/inet.h>
#include <bitcoin/script.h>
#include <bitcoin/tx.h>
#include <ccan/array_size/array_size.h>
#include <ccan/io/io.h>
#include <ccan/noerr/noerr.h>
#include <ccan/str/str.h>
@ -660,6 +661,19 @@ static void gossipd_getpeers_complete(struct subd *gossip, const u8 *msg,
json_add_num(response, "max_accepted_htlcs",
channel->our_config.max_accepted_htlcs);
json_array_start(response, "status");
for (size_t i = 0;
i < ARRAY_SIZE(channel->billboard.permanent);
i++) {
if (!channel->billboard.permanent[i])
continue;
json_add_string(response, NULL,
channel->billboard.permanent[i]);
}
if (channel->billboard.transient)
json_add_string(response, NULL,
channel->billboard.transient);
json_array_end(response);
json_object_end(response);
}
json_array_end(response);