From 5bfddad67c88bc74196742e16e6391a0ad00e87b Mon Sep 17 00:00:00 2001 From: f321x Date: Mon, 12 May 2025 10:53:12 +0200 Subject: [PATCH] use daemon.load_wallet instead of constructing manually --- electrum/gui/text.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/electrum/gui/text.py b/electrum/gui/text.py index 4fa602ea7..861e5e1c5 100644 --- a/electrum/gui/text.py +++ b/electrum/gui/text.py @@ -63,15 +63,14 @@ class ElectrumGui(BaseElectrumGui, EventListener): BaseElectrumGui.__init__(self, config=config, daemon=daemon, plugins=plugins) self.network = daemon.network storage = WalletStorage(config.get_wallet_path(use_gui_last_wallet=True)) + password = None if not storage.file_exists(): print("Wallet not found. try 'electrum create'") exit() if storage.is_encrypted(): password = getpass.getpass('Password:', stream=None) - storage.decrypt(password) - db = WalletDB(storage.read(), storage=storage, upgrade=True) - self.wallet = Wallet(db, config=config) # type: Optional[Abstract_Wallet] - self.wallet.start_network(self.network) + del storage + self.wallet = self.daemon.load_wallet(config.get_wallet_path(use_gui_last_wallet=True), password) self.contacts = self.wallet.contacts locale.setlocale(locale.LC_ALL, '')