1
0

anchor channels: unlock wallet on startup if the wallet has channels

This commit is contained in:
ThomasV
2024-12-18 10:40:49 +01:00
parent 693210edbe
commit ee42e09387
5 changed files with 19 additions and 4 deletions

View File

@@ -251,7 +251,8 @@ class QEDaemon(AuthMixin, QObject):
assert wallet is not None
self._current_wallet = QEWallet.getInstanceFor(wallet)
self.availableWallets.updateWallet(self._path)
self._current_wallet.password = password if password else None
if wallet.requires_unlock():
wallet.unlock(password)
self._loading = False
self.loadingChanged.emit()
self.walletLoaded.emit(self._name, self._path)

View File

@@ -731,12 +731,16 @@ class QEWallet(AuthMixin, QObject, QtEventListener):
try:
self._logger.info('setting new password')
self.wallet.update_password(current_password, password, encrypt_storage=True)
self.password = password
self.wallet.unlock(password)
return True
except InvalidPassword as e:
self._logger.exception(repr(e))
return False
@property
def password(self):
return self.wallet.get_unlocked_password()
@pyqtSlot(str)
def importAddresses(self, addresslist):
self.wallet.import_addresses(addresslist.split())