From 48732f4b41310bc14d60f67d3f2e9225224c7a3e Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Mon, 25 Apr 2022 12:56:10 +0200 Subject: [PATCH] jsonrpc: Add option_zeroconf handling to `listpeers` --- doc/lightning-listpeers.7.md | 4 ++-- doc/schemas/listpeers.schema.json | 3 ++- lightningd/peer_control.c | 2 ++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/doc/lightning-listpeers.7.md b/doc/lightning-listpeers.7.md index 647d3bdfcda4..d957fee4763b 100644 --- a/doc/lightning-listpeers.7.md +++ b/doc/lightning-listpeers.7.md @@ -46,7 +46,7 @@ On success, an object containing **peers** is returned. It is an array of objec - **state** (string): the channel state, in particular "CHANNELD_NORMAL" means the channel can be used normally (one of "OPENINGD", "CHANNELD_AWAITING_LOCKIN", "CHANNELD_NORMAL", "CHANNELD_SHUTTING_DOWN", "CLOSINGD_SIGEXCHANGE", "CLOSINGD_COMPLETE", "AWAITING_UNILATERAL", "FUNDING_SPEND_SEEN", "ONCHAIN", "DUALOPEND_OPEN_INIT", "DUALOPEND_AWAITING_LOCKIN") - **opener** (string): Who initiated the channel (one of "local", "remote") - **features** (array of strings): - - BOLT #9 features which apply to this channel (one of "option_static_remotekey", "option_anchor_outputs") + - BOLT #9 features which apply to this channel (one of "option_static_remotekey", "option_anchor_outputs", "option_zeroconf") - **scratch_txid** (txid, optional): The txid we would use if we went onchain now - **feerate** (object, optional): Feerates for the current tx: - **perkw** (u32): Feerate per 1000 weight (i.e kSipa) @@ -381,4 +381,4 @@ Main web site: Lightning RFC site (BOLT \#9): -[comment]: # ( SHA256STAMP:e6829e8ced923131b95bcfa4f366dd04286fe85485039e9ebc89e79899937df6) +[comment]: # ( SHA256STAMP:2e8bcc66531b2dce44b94c42852b624bdd9435cc63495fc799458fa5522f0ea9) diff --git a/doc/schemas/listpeers.schema.json b/doc/schemas/listpeers.schema.json index f9ac1cad27f9..2979f78cce52 100644 --- a/doc/schemas/listpeers.schema.json +++ b/doc/schemas/listpeers.schema.json @@ -327,7 +327,8 @@ "type": "string", "enum": [ "option_static_remotekey", - "option_anchor_outputs" + "option_anchor_outputs", + "option_zeroconf" ], "description": "BOLT #9 features which apply to this channel" } diff --git a/lightningd/peer_control.c b/lightningd/peer_control.c index bfb828ba2552..f68345b2f1d8 100644 --- a/lightningd/peer_control.c +++ b/lightningd/peer_control.c @@ -749,6 +749,8 @@ static void json_add_channel(struct lightningd *ld, json_add_string(response, NULL, "option_static_remotekey"); if (channel_has(channel, OPT_ANCHOR_OUTPUTS)) json_add_string(response, NULL, "option_anchor_outputs"); + if (channel_has(channel, OPT_ZEROCONF)) + json_add_string(response, NULL, "option_zeroconf"); json_array_end(response); if (!amount_sat_sub(&peer_funded_sats, channel->funding_sats,