URI: 
       tfix issue #1853 - electrum - Electrum Bitcoin wallet
  HTML git clone https://git.parazyd.org/electrum
   DIR Log
   DIR Files
   DIR Refs
   DIR Submodules
       ---
   DIR commit c6a46df15887736969c7a7a448c76f9a9ed0c21e
   DIR parent 0328caa22ab787ff37567ee098edc5db96769a88
  HTML Author: ThomasV <thomasv@electrum.org>
       Date:   Fri,  1 Jul 2016 16:19:26 +0200
       
       fix issue #1853
       
       Diffstat:
         M gui/qt/main_window.py               |      11 ++---------
         M lib/commands.py                     |       2 ++
         M lib/wallet.py                       |       2 ++
       
       3 files changed, 6 insertions(+), 9 deletions(-)
       ---
   DIR diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py
       t@@ -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):
   DIR diff --git a/lib/commands.py b/lib/commands.py
       t@@ -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
   DIR diff --git a/lib/wallet.py b/lib/wallet.py
       t@@ -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