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

listpeerchannels: split conversion into stages #5825

Merged
merged 14 commits into from
Jan 13, 2023

Commits on Jan 12, 2023

  1. lightningd: prepare internal json routines for listpeerchannels.

    We're soon going to call json_add_unsaved_channel and
    json_add_uncommitted_channel from a new place, where we want the peer
    state directly included.
    
    Based on patch by @vincenzopalazzo.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jan 12, 2023
    Configuration menu
    Copy the full SHA
    d586d9a View commit details
    Browse the repository at this point in the history
  2. lightningd: add listpeerchannels command

    Changelog-Added: JSON-RPC: new command `listpeerchannels` now contains information on direct channels with our peers.
    
    Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
    vincenzopalazzo authored and rustyrussell committed Jan 12, 2023
    Configuration menu
    Copy the full SHA
    8e69aab View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    de9ecd1 View commit details
    Browse the repository at this point in the history
  4. plugins/libplugin: flatten return from json_to_listpeers_result.

    Instead of returning a peers -> channels heirarchy, return (as callers
    want!) a flat array of channels.
    
    This is actually most of the transition work to make them work with
    listpeerchannels.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jan 12, 2023
    Configuration menu
    Copy the full SHA
    2138776 View commit details
    Browse the repository at this point in the history
  5. libplugin: don't return unopened channels from json_to_listpeers_chan…

    …nels().
    
    This way we always have an SCID and a direction.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jan 12, 2023
    Configuration menu
    Copy the full SHA
    8dd41d5 View commit details
    Browse the repository at this point in the history
  6. pay: use json_to_listpeers_channels() for local_channel_hints.

    Don't parse the listpeers.channels output ourselves: with two extra fields
    we can simply reuse json_to_listpeers_channels().
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jan 12, 2023
    Configuration menu
    Copy the full SHA
    3b7775a View commit details
    Browse the repository at this point in the history
  7. plugins: use listpeerchannels instead of listpeers.

    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jan 12, 2023
    Configuration menu
    Copy the full SHA
    2ca2065 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    f3f418e View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    3230b6b View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    c1a5deb View commit details
    Browse the repository at this point in the history
  11. tests: use listpeerchannels.

    vincenzopalazzo authored and rustyrussell committed Jan 12, 2023
    Configuration menu
    Copy the full SHA
    fcf6484 View commit details
    Browse the repository at this point in the history
  12. pytest: fix race in test_bookkeeping_closing_subsat_htlcs

    With the next change (which, as a side-effect, speeds up listpeers),
    we seem to hit a race in this test.  The bookkeeper doesn't get to
    process the final payment before the node is shutdown.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jan 12, 2023
    Configuration menu
    Copy the full SHA
    9e8a8db View commit details
    Browse the repository at this point in the history
  13. lightningd: deprecate listpeers.channels

    Changelog-Deprecated: JSON-RPC: `listpeers` `channels` array: use `listpeerchannels`
    
    Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
    vincenzopalazzo authored and rustyrussell committed Jan 12, 2023
    Configuration menu
    Copy the full SHA
    2dfd4a8 View commit details
    Browse the repository at this point in the history
  14. doc: remove manual field descriptions from listpeerchannels(7).

    Some are best copied into the schema, but some are already
    out-of-date, so cleanest to remove them and rely on the generated (and
    thus, checked!) fields.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Jan 12, 2023
    Configuration menu
    Copy the full SHA
    6b41666 View commit details
    Browse the repository at this point in the history