Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output channel_id in listfunds #6029

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .msggen.json
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,7 @@
},
"ListfundsChannels": {
"ListFunds.channels[].amount_msat": 3,
"ListFunds.channels[].channel_id": 9,
"ListFunds.channels[].connected": 6,
"ListFunds.channels[].funding_output": 5,
"ListFunds.channels[].funding_txid": 4,
Expand Down
1 change: 1 addition & 0 deletions cln-grpc/proto/node.proto

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

2 changes: 2 additions & 0 deletions cln-grpc/src/convert.rs

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

1 change: 1 addition & 0 deletions cln-rpc/src/model.rs

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

1 change: 1 addition & 0 deletions contrib/pyln-testing/pyln/testing/grpc2py.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ def listfunds_channels2py(m):
"funding_output": m.funding_output, # PrimitiveField in generate_composite
"connected": m.connected, # PrimitiveField in generate_composite
"state": str(m.state), # EnumField in generate_composite
"channel_id": hexlify(m.channel_id), # PrimitiveField in generate_composite
"short_channel_id": m.short_channel_id, # PrimitiveField in generate_composite
})

Expand Down
3 changes: 2 additions & 1 deletion doc/lightning-listfunds.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ On success, an object is returned, containing:
- **funding\_output** (u32): the 0-based index of the output in the funding transaction
- **connected** (boolean): whether the channel peer is connected
- **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")
- **channel\_id** (hash): The full channel\_id (funding txid Xored with output number) *(added v23.02)*

If **state** is "CHANNELD\_NORMAL":

Expand All @@ -73,4 +74,4 @@ RESOURCES

Main web site: <https://github.com/ElementsProject/lightning>

[comment]: # ( SHA256STAMP:3282d4025e161d6926878a5fc8d78384784885749630f007cc5dfcd8d2794b10)
[comment]: # ( SHA256STAMP:ae6228c9cc323e0b6486eb4d2695105b087e98770763c6f9e5af3b888fa9520f)
10 changes: 9 additions & 1 deletion doc/schemas/listfunds.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@
"funding_txid",
"funding_output",
"connected",
"state"
"state",
"channel_id"
],
"properties": {
"peer_id": {
Expand Down Expand Up @@ -186,6 +187,11 @@
"DUALOPEND_AWAITING_LOCKIN"
],
"description": "the channel state, in particular \"CHANNELD_NORMAL\" means the channel can be used normally"
},
"channel_id": {
"type": "hash",
"description": "The full channel_id (funding txid Xored with output number)",
"added": "v23.05"
}
},
"allOf": [
Expand Down Expand Up @@ -215,6 +221,7 @@
"funding_output": {},
"connected": {},
"state": {},
"channel_id": {},
"short_channel_id": {
"type": "short_channel_id",
"description": "short channel id of channel"
Expand Down Expand Up @@ -251,6 +258,7 @@
"funding_output": {},
"connected": {},
"state": {},
"channel_id": {},
"short_channel_id": {
"type": "short_channel_id",
"description": "short channel id of channel (only if funding reached lockin depth before closing)"
Expand Down
1 change: 1 addition & 0 deletions wallet/walletrpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,7 @@ static struct command_result *json_listfunds(struct command *cmd,
channel_is_connected(c));
json_add_string(response, "state",
channel_state_name(c));
json_add_channel_id(response, "channel_id", &c->cid);
if (c->scid)
json_add_short_channel_id(response,
"short_channel_id",
Expand Down