Skip to content

Commit 2d61979

Browse files
committed
Add ommitted block_in_place
1 parent a9c072f commit 2d61979

File tree

1 file changed

+18
-15
lines changed

1 file changed

+18
-15
lines changed

src/lib.rs

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -299,22 +299,25 @@ impl<K: KVStore + Sync + Send + 'static> Node<K> {
299299
// Block to ensure we update our fee rate cache once on startup
300300
let wallet = Arc::clone(&self.wallet);
301301
let sync_logger = Arc::clone(&self.logger);
302-
runtime.block_on(async move {
303-
let now = Instant::now();
304-
match wallet.update_fee_estimates().await {
305-
Ok(()) => {
306-
log_info!(
307-
sync_logger,
308-
"Initial fee rate cache update finished in {}ms.",
309-
now.elapsed().as_millis()
310-
);
311-
Ok(())
312-
}
313-
Err(e) => {
314-
log_error!(sync_logger, "Initial fee rate cache update failed: {}", e,);
315-
Err(e)
302+
let runtime_ref = &runtime;
303+
tokio::task::block_in_place(move || {
304+
runtime_ref.block_on(async move {
305+
let now = Instant::now();
306+
match wallet.update_fee_estimates().await {
307+
Ok(()) => {
308+
log_info!(
309+
sync_logger,
310+
"Initial fee rate cache update finished in {}ms.",
311+
now.elapsed().as_millis()
312+
);
313+
Ok(())
314+
}
315+
Err(e) => {
316+
log_error!(sync_logger, "Initial fee rate cache update failed: {}", e,);
317+
Err(e)
318+
}
316319
}
317-
}
320+
})
318321
})?;
319322

320323
// Setup wallet sync

0 commit comments

Comments
 (0)