Skip to content

Commit

Permalink
jsonrpc: Add option_zeroconf handling to listpeers
Browse files Browse the repository at this point in the history
  • Loading branch information
cdecker committed Jul 4, 2022
1 parent 848a83a commit 48732f4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions doc/lightning-listpeers.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -381,4 +381,4 @@ Main web site: <https://github.com/ElementsProject/lightning> Lightning
RFC site (BOLT \#9):
<https://github.com/lightningnetwork/lightning-rfc/blob/master/09-features.md>

[comment]: # ( SHA256STAMP:e6829e8ced923131b95bcfa4f366dd04286fe85485039e9ebc89e79899937df6)
[comment]: # ( SHA256STAMP:2e8bcc66531b2dce44b94c42852b624bdd9435cc63495fc799458fa5522f0ea9)
3 changes: 2 additions & 1 deletion doc/schemas/listpeers.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down
2 changes: 2 additions & 0 deletions lightningd/peer_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 48732f4

Please sign in to comment.