From 78859e759d5c0acf7edd7c9e9dcf24ac8cb72f8b Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Sun, 15 Nov 2026 10:56:44 +0000 Subject: [PATCH] xmrwallet.ops.wallet: clean up `need_daemon_start` --- mmgen/xmrwallet/ops/wallet.py | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/mmgen/xmrwallet/ops/wallet.py b/mmgen/xmrwallet/ops/wallet.py index 5e8df520..ff2c4879 100644 --- a/mmgen/xmrwallet/ops/wallet.py +++ b/mmgen/xmrwallet/ops/wallet.py @@ -99,16 +99,14 @@ class OpWallet(OpBase): if not self.skip_wallet_check: self.to_process = check_wallets() - self.need_daemon_start = False - if ( - self.to_process - and self.start_daemon - and not self.cfg.no_start_wallet_daemon - and not (self.cfg.no_restart_wallet_daemon and self.wd.state == 'ready')): - if self.main_starts_daemon: - self.need_daemon_start = True - else: - asyncio.run(self.restart_wallet_daemon()) + self.need_daemon_start = ( + self.to_process + and self.start_daemon + and not self.cfg.no_start_wallet_daemon + and not (self.cfg.no_restart_wallet_daemon and self.wd.state == 'ready')) + + if self.need_daemon_start and not self.main_starts_daemon: + asyncio.run(self.restart_wallet_daemon()) @staticmethod def stat_wallet(fn): @@ -206,7 +204,7 @@ class OpWallet(OpBase): return 'offline signing ' if self.cfg.offline else 'watch-only ' if self.cfg.watch_only else '' async def main(self): - if self.main_starts_daemon and self.need_daemon_start: + if self.need_daemon_start and self.main_starts_daemon: await self.restart_wallet_daemon() if self.to_process and not self.compat_call: