We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c176c0e commit 5fbed07Copy full SHA for 5fbed07
client/src/sync.rs
@@ -267,7 +267,7 @@ impl Spaced {
267
_ => panic!("unsupported network"),
268
};
269
270
- let source = BitcoinBlockSource::new(rpc.clone());
+
271
272
// Wait for the RPC node to be ready
273
let mut attempts = 0;
@@ -282,8 +282,13 @@ impl Spaced {
282
last_error
283
));
284
}
285
- let best_chain =
286
- source.get_best_chain(Some(anchor.height), network.fallback_network());
+ let rpc_task = rpc.clone();
287
+ let net_task = network.fallback_network();
288
+ let best_chain = tokio::task::spawn_blocking(move || {
289
+ let source = BitcoinBlockSource::new(rpc_task);
290
+ source.get_best_chain(Some(anchor.height), net_task)
291
+ }).await.expect("join");
292
293
match best_chain {
294
Ok(Some(tip)) => {
0 commit comments