File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -267,7 +267,7 @@ impl Spaced {
267
267
_ => panic ! ( "unsupported network" ) ,
268
268
} ;
269
269
270
- let source = BitcoinBlockSource :: new ( rpc . clone ( ) ) ;
270
+
271
271
272
272
// Wait for the RPC node to be ready
273
273
let mut attempts = 0 ;
@@ -282,8 +282,13 @@ impl Spaced {
282
282
last_error
283
283
) ) ;
284
284
}
285
- let best_chain =
286
- source. get_best_chain ( Some ( anchor. height ) , network. fallback_network ( ) ) ;
285
+
286
+ 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" ) ;
287
292
288
293
match best_chain {
289
294
Ok ( Some ( tip) ) => {
You can’t perform that action at this time.
0 commit comments