From a010fa33978eea2bb1920da6700c178729712f9c Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Mon, 9 Nov 2026 09:33:33 +0000 Subject: [PATCH] xmrwallet.ops: sign, import: open wallet only if necessary --- mmgen/xmrwallet/ops/import.py | 3 ++- mmgen/xmrwallet/ops/sign.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/mmgen/xmrwallet/ops/import.py b/mmgen/xmrwallet/ops/import.py index f6754dfc..7af7cc72 100644 --- a/mmgen/xmrwallet/ops/import.py +++ b/mmgen/xmrwallet/ops/import.py @@ -26,7 +26,8 @@ class OpImportOutputs(OpWallet): async def process_wallet(self, d, fn, last): h = MoneroWalletRPC(self, d) - h.open_wallet(refresh=False) + if self.need_daemon_start or len(self.kal.data) != 1: + h.open_wallet(refresh=False) self.head_msg(d.idx, h.fn) outputs_file = Path(self.uargs.spec) m = MoneroWalletOutputsFile.Unsigned(parent=self, fn=outputs_file) diff --git a/mmgen/xmrwallet/ops/sign.py b/mmgen/xmrwallet/ops/sign.py index 31fc3af6..5f91470a 100644 --- a/mmgen/xmrwallet/ops/sign.py +++ b/mmgen/xmrwallet/ops/sign.py @@ -23,7 +23,8 @@ class OpSign(OpWallet): async def process_wallet(self, d, fn, last): h = MoneroWalletRPC(self, d) - h.open_wallet(refresh=False) + if self.need_daemon_start or len(self.kal.data) != 1: + h.open_wallet(refresh=False) self.head_msg(d.idx, h.fn) tx = self.get_tx_cls('Unsigned')(self.cfg, Path(self.uargs.spec)) res = self.c.call(