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

listpeers: add num_channels #5968

Merged

Conversation

m-schmoock
Copy link
Collaborator

This will be helpful for plugins and because of the listpeerchannels listpeers split, so that we can reduce unnecessary RPC ping/pong calls when num_channels is 0.

A lot of plugins still need to iterate both calls, so then they can save some IO load and delays.

This will save a lot of RPC ping/pong when plugins still need to iterate
both, `listpeers` and `listpeerchannels`. When `num_channels` is 0 they
can skip additional calls.

Changelog-Added: RPC `listpeers` output now has `num_channels`.
@m-schmoock
Copy link
Collaborator Author

Q: Is there a helper to count a list instead of list_for_each .. ++ ?

Copy link
Contributor

@rustyrussell rustyrussell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is a good idea.

Ack 1d51711

@m-schmoock
Copy link
Collaborator Author

There was just a typo in the schema that I force pushed right now...

@m-schmoock
Copy link
Collaborator Author

m-schmoock commented Feb 7, 2023

@rustyrussell Can we have this in 23, because otherwise I need ugly if/else code everywhere in the plugins when it comes to listpeerchannels deprecation code.

Copy link
Collaborator

@vincenzopalazzo vincenzopalazzo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK b007076

Copy link
Member

@cdecker cdecker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor.issue with field renumbering, otherwise good 👍

.msggen.json Outdated Show resolved Hide resolved
@rustyrussell
Copy link
Contributor

Ack 2bdc819

@endothermicdev endothermicdev merged commit 1e951a9 into ElementsProject:master Feb 7, 2023
@m-schmoock m-schmoock deleted the listpeers/num_channels branch February 7, 2023 22:09
@cdecker
Copy link
Member

cdecker commented Feb 8, 2023

ACK 2bdc819

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.

None yet

5 participants