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 2 #13

Merged
merged 4 commits into from
Mar 18, 2024
Merged

Conversation

rolznz
Copy link

@rolznz rolznz commented Mar 18, 2024

No description provided.

tnull and others added 4 commits March 18, 2024 12:41
.. which we somehow so far ommitted exposing in the API.

We now introduce a `force` flag to `close_channel` and broadcast if the
counterparty is not trusted.
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.
.. no need to keep the wallet locked if we're sleeping. So we're
dropping and re-locking.
@rolznz rolznz merged commit 6477bab 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