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

Refactor peer connection establishment #541

Merged
merged 2 commits into from
Nov 9, 2023
Merged

Conversation

t-bast
Copy link
Member

@t-bast t-bast commented Sep 27, 2023

Use the same pattern as the ElectrumClient, with an explicit job and timeouts. The connect function now suspends, which makes it easier to handle from the caller's point of view.

We don't have an easy way of unit testing that in lightning-kmp, so this will deserve some e2e tests.

Fixes #531

@t-bast t-bast requested a review from dpad85 September 27, 2023 08:02
dpad85 added a commit to ACINQ/phoenix that referenced this pull request Oct 17, 2023
This commits uses the new Peer connection timeouts added in
ACINQ/lightning-kmp#541

Note that the timeouts depend on the number of consecutive
failed connection attempts, and whether TOR is enabled or
not.
Use the same pattern as the `ElectrumClient`, with an explicit job and
timeouts. The `connect` function now suspends, which makes it easier to
handle from the caller's point of view.

Fixes #531
@t-bast t-bast force-pushed the peer-connection-timeout branch from 2746ddd to ff7a089 Compare November 3, 2023 08:14
Copy link
Member

@dpad85 dpad85 left a comment

Choose a reason for hiding this comment

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

LGTM, just a nit

@t-bast t-bast merged commit 26b2de6 into master Nov 9, 2023
2 checks passed
@t-bast t-bast deleted the peer-connection-timeout branch November 9, 2023 18:01
dpad85 added a commit to ACINQ/phoenix that referenced this pull request Nov 16, 2023
A dynamic timeout is used when connecting to Peer/Electrum.

Note that the timeouts depend on the number of consecutive
failed connection attempts, and whether TOR is enabled or
not.

This commits uses the new Peer connection timeouts added in
ACINQ/lightning-kmp#541
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.

Connection issues analysis
2 participants