File tree Expand file tree Collapse file tree 1 file changed +21
-12
lines changed Expand file tree Collapse file tree 1 file changed +21
-12
lines changed Original file line number Diff line number Diff line change @@ -290,18 +290,27 @@ def ensure_layer2_ready(self) -> None:
290
290
print ("Syncing light clients:" )
291
291
self ._print_lnd_cfheaders (erase_last_line = False )
292
292
293
- with ThreadPoolExecutor (max_workers = len (self .lnd_cfheaders ), thread_name_prefix = "LndReady" ) as executor :
294
- futs = {}
295
- for chain in self .lnd_cfheaders :
296
- futs [executor .submit (self .ensure_lnd_ready , chain )] = chain
297
-
298
- done , not_done = wait (futs )
299
-
300
- if len (not_done ) > 0 :
301
- for f in not_done :
302
- f .cancel ()
303
- lnds = ", " .join ([futs [f ] for f in not_done ])
304
- raise FatalError ("Failed to wait for {} to be ready" .format (lnds ))
293
+ with ThreadPoolExecutor (max_workers = 2 , thread_name_prefix = "LndReady" ) as executor :
294
+ native_lndbtc = self .config .nodes ["lndbtc" ]["mode" ] == "native"
295
+ native_lndltc = self .config .nodes ["lndltc" ]["mode" ] == "native"
296
+
297
+ if native_lndbtc :
298
+ f1 = executor .submit (self .ensure_lnd_ready , "bitcoin" )
299
+
300
+ if native_lndltc :
301
+ f2 = executor .submit (self .ensure_lnd_ready , "litecoin" )
302
+
303
+ if native_lndbtc :
304
+ try :
305
+ f1 .result ()
306
+ except Exception as e :
307
+ raise FatalError ("Failed to wait for lndbtc to be ready" ) from e
308
+
309
+ if native_lndltc :
310
+ try :
311
+ f2 .result ()
312
+ except Exception as e :
313
+ raise FatalError ("Failed to wait for lndltc to be ready" ) from e
305
314
306
315
if self .node_manager .newly_installed :
307
316
print ()
You can’t perform that action at this time.
0 commit comments