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

Chore: update anchor support #12

Merged
merged 2 commits into from
Mar 18, 2024
Merged

Chore: update anchor support #12

merged 2 commits into from
Mar 18, 2024

Conversation

rolznz
Copy link

@rolznz rolznz commented Mar 18, 2024

fixes possible freeze when opening an anchor channel

tnull and others added 2 commits March 18, 2024 11:41
Unfortunately BDK's current wallet design requires us to have it live in `Mutex`
that is locked for long periods of time during syncing. This is
especially painful for short-lived operations that just operate locally,
such as retrieving the current balance, which we now do in several
places to be able to check Anchor channels limitations, e.g., in event
handling.

In order to avoid blocking during balance retrieval, we introduce a
`balance` cache that will be refreshed whenever we're done with syncing
*or* when we can successfully get the wallet lock. Otherwise, we'll just
return the cached value, allowing us to make progress even though a
background sync of the wallet might be in-progress.
@rolznz rolznz merged commit 7d03cef into main Mar 18, 2024
10 checks passed
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