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

Remove Peer.bootChannels map #485

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

Remove Peer.bootChannels map #485

wants to merge 3 commits into from

Conversation

pm47
Copy link
Member

@pm47 pm47 commented Jun 21, 2023

Right after starting a Peer, the channels map is empty because it is loaded asynchronously in a coroutine. Library integrators need a way to differentiate between "channels not yet loaded" and "no channels at all", otherwise they may e.g. display a 0 sat balance for a short amount of time.

Instead of using a nullable map bootChannels, we add an explicit initialized boolean.

pm47 added 2 commits June 21, 2023 14:02
The purpose is to signal when the peer has loaded channels from the
database, allowing the caller to differentiate between "channels not yet
loaded" and "no channels at all".
@pm47 pm47 requested a review from dpad85 June 21, 2023 12:07
@dpad85
Copy link
Member

dpad85 commented Jun 22, 2023

Note: this PR is paused as there are side-effects with electrum (see #483 (comment)). Removing the explicit bootChannels flow prevents us from distinguishing:

  • channels not loaded yet
  • channels loaded from local database
  • channels loaded and reestablished with the peer (<- depends on the Electrum feerates)

@pm47 pm47 marked this pull request as draft June 23, 2023 11:03
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.

2 participants