From 720d80c19e1e63c873df95e4fcf382cc09dca47d Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Sun, 1 Nov 2026 12:51:06 +0000 Subject: [PATCH] xmrwallet OpWallet: new `main_starts_daemon` attr --- mmgen/xmrwallet/ops/wallet.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/mmgen/xmrwallet/ops/wallet.py b/mmgen/xmrwallet/ops/wallet.py index a37ea9ee..7a725796 100644 --- a/mmgen/xmrwallet/ops/wallet.py +++ b/mmgen/xmrwallet/ops/wallet.py @@ -35,6 +35,7 @@ class OpWallet(OpBase): start_daemon = True skip_wallet_check = False # for debugging disable_authentication = False + main_starts_daemon = False def __init__(self, cfg, uarg_tuple): @@ -109,8 +110,15 @@ class OpWallet(OpBase): if not self.skip_wallet_check: self.to_process = check_wallets() - if self.to_process and self.start_daemon and not self.cfg.no_start_wallet_daemon: - asyncio.run(self.restart_wallet_daemon()) + self.need_daemon_start = False + if ( + self.to_process + and self.start_daemon + and not self.cfg.no_start_wallet_daemon): + if self.main_starts_daemon: + self.need_daemon_start = True + else: + asyncio.run(self.restart_wallet_daemon()) @staticmethod def stat_wallet(fn): @@ -200,6 +208,9 @@ 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: + await self.restart_wallet_daemon() + if self.to_process and not self.compat_call: gmsg('\n{a}ing {b} {c}wallet{d}'.format( a = self.stem.capitalize(),