Skip to content

Commit c31b29f

Browse files
committed
Use Multi threaded runtime in sync_wallets
This is needed since so that components(such as `KVStore`) can use `block_in_place`. `block_in_place` is only allowed inside a multi-threaded runtime. `sync_wallets` internally syncs channel_manager and chain_monitor which results in persistence using `KVStore`. Using blocking `sync_wallets` should be avoided but is mostly used in functional_tests.
1 parent fc09bfb commit c31b29f

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)