-
Notifications
You must be signed in to change notification settings - Fork 311
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Wallet
and EsploraBlockchain
are thread-safe*+
*If the user intends to use the `bdk::Wallet` concurrently, the user MUST wrap `bdk::Wallet` with a `Mutex` of some sort. This is because BDK's calls to `RefCell::borrow` and `RefCell::borrow_mut` assumed (implicitly due to `bdk::Wallet` not being `Send` until this commit) that the user was running `bdk::Wallet` in a single thread. Failure to keep calls to `bdk::Wallet` mutually exclusive will result in panics when BDK internally calls `try_lock().unwrap()` from multiple threads at once. +If the user intends to use BDK using the async interface, the `Mutex` that wraps `bdk::Wallet` must additionally be async-aware, such as `futures::lock::Mutex` or `tokio::sync::Mutex`. This is because `bdk::Wallet::sync` is async, and the lock on the `bdk::Wallet` needs to be held across `.await`, and therefore the `MutexGuard` must be `Send` + `Sync`.
- Loading branch information
Showing
10 changed files
with
64 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters