Skip to content

Auto-reconnect to peers we have channels to #1281

Description

@ZmnSCPxj

#1274 brings up that our peers with whom we have channels to, often end up having connected: false.

One way to help this is to have a periodic auto-reconnect every 5 to 10 minutes, to all known peers with whom we have channels to.

  1. Modify connect so it can be invoked internally. See what I did in lightningd/pay.c to sendpay command: I made a public send_payment function that is given a callback for completion or failure, as well as a struct sendpay_result for the result of payment. This is needed so that connect can be invoked internally by lightningd.
  2. Set up a tweakable autoconnect system (can set autoonnect cycle time range by command line, default 5 to 10 minutes). Make sure to randomize the time between autoconnect attempts to reduce network spike. Pay attention to addr_unknown field from the gossip connection failure message: if this is true then we really cannot connect to the peer due to lack of knowledge of address.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureAimed at improving the existing functionality or a new feature that provides additional valuegossip

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions