From c66da635a2a9a5154b72547b62763c54743d6740 Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Tue, 29 Sep 2026 09:23:24 +0000 Subject: [PATCH] OpWallet: remove unnecessary loop in initializer --- mmgen/xmrwallet/ops/wallet.py | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/mmgen/xmrwallet/ops/wallet.py b/mmgen/xmrwallet/ops/wallet.py index 0b6ea08e..58a53cc7 100755 --- a/mmgen/xmrwallet/ops/wallet.py +++ b/mmgen/xmrwallet/ops/wallet.py @@ -97,24 +97,14 @@ class OpWallet(OpBase): skip_chksum_msg = True) else: self.mount_removable_device() - # with watch_only, make a second attempt to open the file as KeyAddrList: - for first_try in (True, False): - addr_list = ViewKeyAddrList if (self.cfg.watch_only and first_try) else KeyAddrList - try: - self.kal = addr_list( - cfg = cfg, - proto = self.proto, - infile = - str(self.autosign_viewkey_addr_file) if self.cfg.autosign else - self.uargs.infile, - key_address_validity_check = True, - skip_chksum_msg = True) - break - except: - if first_try: - msg(f'Attempting to open ‘{self.uargs.infile}’ as key-address list') - continue - raise + self.kal = (ViewKeyAddrList if self.cfg.watch_only else KeyAddrList)( + cfg = cfg, + proto = self.proto, + infile = + str(self.autosign_viewkey_addr_file) if self.cfg.autosign else + self.uargs.infile, + key_address_validity_check = True, + skip_chksum_msg = True) self.create_addr_data()