File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -290,6 +290,7 @@ impl BitcoinD {
290
290
. spawn ( ) ?;
291
291
292
292
let node_url_default = format ! ( "{}/wallet/default" , rpc_url) ;
293
+ let mut i = 0 ;
293
294
// wait bitcoind is ready, use default wallet
294
295
let client = loop {
295
296
if let Some ( status) = process. try_wait ( ) ? {
@@ -303,9 +304,10 @@ impl BitcoinD {
303
304
return Err ( Error :: EarlyExit ( status) ) ;
304
305
}
305
306
}
306
- thread:: sleep ( Duration :: from_millis ( 500 ) ) ;
307
+ thread:: sleep ( Duration :: from_millis ( 100 ) ) ;
307
308
assert ! ( process. stderr. is_none( ) ) ;
308
309
let client_result = Client :: new ( & rpc_url, Auth :: CookieFile ( cookie_file. clone ( ) ) ) ;
310
+
309
311
if let Ok ( client_base) = client_result {
310
312
// RpcApi has get_blockchain_info method, however being generic with `Value` allows
311
313
// to be compatible with different version, in the end we are only interested if
@@ -322,6 +324,14 @@ impl BitcoinD {
322
324
break Client :: new ( & node_url_default, Auth :: CookieFile ( cookie_file. clone ( ) ) ) ?;
323
325
}
324
326
}
327
+
328
+ debug ! (
329
+ "bitcoin client for process {} not ready ({})" ,
330
+ process. id( ) ,
331
+ i
332
+ ) ;
333
+
334
+ i += 1 ;
325
335
} ;
326
336
327
337
Ok ( BitcoinD {
You can’t perform that action at this time.
0 commit comments