Skip to content

Conversation

@rustyrussell
Copy link
Contributor

Requested-by: @whitslack
Closes: #8233
Changelog-Added: JSON-RPC: listpeerchannels now has a short_channel_id parameter for just listing a specific channel.

Requested-by: @whitslack
Closes: ElementsProject#8233
Changelog-Added: JSON-RPC: `listpeerchannels` now has a `short_channel_id` parameter for just listing a specific channel.
Signed-off-by: Rusty Russell <[email protected]>
@rustyrussell rustyrussell added this to the v25.05 milestone Apr 15, 2025
@rustyrussell rustyrussell requested a review from cdecker as a code owner April 15, 2025 07:39
@whitslack
Copy link
Collaborator

Not as convenient as allowing either form in the id parameter, as this means I'll have to type lightning-cli -k listpeerchannels short_channel_id=876543x21x0 instead of just lightning-cli listpeerchannels 876543x21x0. Of course, I could add an alias in my shell profile to save me the extra typing, but if I wanted to do that, I could have already implemented a jq filter atop the unparameterized listpeerchannels, which would have (mostly) obviated this feature request. Still, implementing the new parameter is a win because it can cut down on the volume of data that the RPC returns, so I thank you for your effort and very quick response time. 🍻

@rustyrussell
Copy link
Contributor Author

Yes. Changing the type of an argument is problematic, because of grpc, which relies on the type. We get away with it for setchannel where we allow scid/peerid/channelid because we always did, and said it's just a "string" type.

lightning-cli listpeerchannels null 876543x21x0 works tho!

@whitslack
Copy link
Collaborator

lightning-cli listpeerchannels null 876543x21x0 works tho!

I didn't know positional arguments could be explicitly skipped by passing a literal 'null'. That completely addresses my complaint. Thank you!

@rustyrussell rustyrussell merged commit 8974375 into ElementsProject:master Apr 28, 2025
39 of 40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: listpeerchannels should allow querying by SCID

2 participants