1
0

daemon: load_wallet: add force_check_password arg, and use it in qml

- fix: qml gui errors when trying to open a wallets with only keystore-encryption
  - fixes https://github.com/spesmilo/electrum/issues/10171
- qml gui to prompt for password on wallet open even if wallet is not storage-encrypted
This commit is contained in:
SomberNight
2025-08-23 16:54:48 +00:00
parent 23a82f328f
commit 92bdc4d4ca
3 changed files with 105 additions and 11 deletions

View File

@@ -201,7 +201,7 @@ class QEDaemon(AuthMixin, QObject):
wallet_already_open = self.daemon.get_wallet(self._path)
if wallet_already_open is not None:
wallet_already_open_password = QEWallet.getInstanceFor(wallet_already_open).password
password = QEWallet.getInstanceFor(wallet_already_open).password
def load_wallet_task():
success = False
@@ -209,7 +209,13 @@ class QEDaemon(AuthMixin, QObject):
local_password = password # need this in local scope
wallet = None
try:
wallet = self.daemon.load_wallet(self._path, local_password, upgrade=True)
wallet = self.daemon.load_wallet(
self._path,
password=local_password,
upgrade=True,
# might have a keystore password, but unencrypted storage. we want to prompt for pw even then:
force_check_password=True,
)
except InvalidPassword:
self.walletRequiresPassword.emit(self._name, self._path)
except FileNotFoundError:
@@ -224,11 +230,6 @@ class QEDaemon(AuthMixin, QObject):
if wallet is None:
return
if wallet_already_open is not None:
# wallet already open. daemon.load_wallet doesn't mind, but
# we need the correct current wallet password below
local_password = wallet_already_open_password
if self.daemon.config.WALLET_USE_SINGLE_PASSWORD:
self._use_single_password = self.daemon.update_password_for_directory(old_password=local_password, new_password=local_password)
self._password = local_password