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 {
290290 . spawn ( ) ?;
291291
292292 let node_url_default = format ! ( "{}/wallet/default" , rpc_url) ;
293+ let mut i = 0 ;
293294 // wait bitcoind is ready, use default wallet
294295 let client = loop {
295296 if let Some ( status) = process. try_wait ( ) ? {
@@ -303,9 +304,10 @@ impl BitcoinD {
303304 return Err ( Error :: EarlyExit ( status) ) ;
304305 }
305306 }
306- thread:: sleep ( Duration :: from_millis ( 500 ) ) ;
307+ thread:: sleep ( Duration :: from_millis ( 100 ) ) ;
307308 assert ! ( process. stderr. is_none( ) ) ;
308309 let client_result = Client :: new ( & rpc_url, Auth :: CookieFile ( cookie_file. clone ( ) ) ) ;
310+
309311 if let Ok ( client_base) = client_result {
310312 // RpcApi has get_blockchain_info method, however being generic with `Value` allows
311313 // to be compatible with different version, in the end we are only interested if
@@ -322,6 +324,14 @@ impl BitcoinD {
322324 break Client :: new ( & node_url_default, Auth :: CookieFile ( cookie_file. clone ( ) ) ) ?;
323325 }
324326 }
327+
328+ debug ! (
329+ "bitcoin client for process {} not ready ({})" ,
330+ process. id( ) ,
331+ i
332+ ) ;
333+
334+ i += 1 ;
325335 } ;
326336
327337 Ok ( BitcoinD {
You can’t perform that action at this time.
0 commit comments