Browse Source

fix issue #1853

283
ThomasV 9 years ago
parent
commit
c6a46df158
  1. 11
      gui/qt/main_window.py
  2. 2
      lib/commands.py
  3. 2
      lib/wallet.py

11
gui/qt/main_window.py

@ -1627,24 +1627,17 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
return
try:
self.wallet.check_password(password)
self.wallet.update_password(password, new_password)
except BaseException as e:
self.show_error(str(e))
return
try:
self.wallet.update_password(password, new_password)
except:
traceback.print_exc(file=sys.stdout)
self.show_error(_('Failed to update password'))
return
if new_password:
msg = _('Password was updated successfully')
else:
msg = _('This wallet is not encrypted')
msg = _('Password was updated successfully') if new_password else _('This wallet is not encrypted')
self.show_message(msg, title=_("Success"))
self.update_lock_icon()
def toggle_search(self):

2
lib/commands.py

@ -94,6 +94,8 @@ class Commands:
cmd = known_commands[method]
if cmd.requires_password and self.wallet.use_encryption:
self._password = apply(password_getter,())
if self._password is None:
return
f = getattr(self, method)
result = f(*args)
self._password = None

2
lib/wallet.py

@ -1107,6 +1107,8 @@ class Abstract_Wallet(PrintError):
tx.sign(keypairs)
def update_password(self, old_password, new_password):
self.check_password(old_password)
if new_password == '':
new_password = None

Loading…
Cancel
Save