Skip to content

Commit 54889d8

Browse files
committed
Have sync_wallets use a multi-threaded runtime
As part of the `OuputSweeper` we broadcast in the `Confirm` implementation, which would be called during transaction syncing. Since our broadcasting happens async but via the intermediate blocking `BroadcasterInterface` we have to transition from `sync_wallets` (blocking) -> LDK/BDK wallet sync (async) -> Confirm (blocking) -> BroadcasterInterface (blocking) -> bdk::Wallet::broadcast (async). However, as the `block_in_place`/`block_on` combo is only usable for multi-threaded runtimes, this new codepath now requires the use of a multi-threaded runtime in `sync_wallets` (note this is the case even though we use a stored, *different* multi-threaded runtime for the actual broadcasting. **sigh**).
1 parent 76d028e commit 54889d8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1003,7 +1003,7 @@ impl<K: KVStore + Sync + Send + 'static> Node<K> {
10031003
];
10041004

10051005
tokio::task::block_in_place(move || {
1006-
tokio::runtime::Builder::new_current_thread().enable_all().build().unwrap().block_on(
1006+
tokio::runtime::Builder::new_multi_thread().enable_all().build().unwrap().block_on(
10071007
async move {
10081008
let now = Instant::now();
10091009
match wallet.sync().await {

0 commit comments

Comments
 (0)