Skip to content

Commit fb50206

Browse files
committed
fixup!
1 parent 5e60a01 commit fb50206

File tree

1 file changed

+21
-12
lines changed

1 file changed

+21
-12
lines changed

images/utils/launcher/check_wallets.py

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -290,18 +290,27 @@ def ensure_layer2_ready(self) -> None:
290290
print("Syncing light clients:")
291291
self._print_lnd_cfheaders(erase_last_line=False)
292292

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
305314

306315
if self.node_manager.newly_installed:
307316
print()

0 commit comments

Comments
 (0)