URI: 
       tOnly write wallet if necessary - electrum - Electrum Bitcoin wallet
  HTML git clone https://git.parazyd.org/electrum
   DIR Log
   DIR Files
   DIR Refs
   DIR Submodules
       ---
   DIR commit c64e8b98856ad3a34be43ed3291169cb52ec66dd
   DIR parent 084a352456a241b6ff4de19f025251f27bf91715
  HTML Author: Neil Booth <kyuupichan@gmail.com>
       Date:   Thu, 10 Sep 2015 17:57:50 +0900
       
       Only write wallet if necessary
       
       Diffstat:
         M gui/qt/main_window.py               |      13 +++++++------
       
       1 file changed, 7 insertions(+), 6 deletions(-)
       ---
   DIR diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py
       t@@ -282,12 +282,13 @@ class ElectrumWindow(QMainWindow, PrintError):
        
            def import_old_contacts(self):
                # backward compatibility: import contacts
       -        addressbook = set(self.wallet.storage.get('contacts', []))
       -        for k in addressbook:
       -            l = self.wallet.labels.get(k)
       -            if bitcoin.is_address(k) and l:
       -                self.contacts[l] = ('address', k)
       -        self.wallet.storage.put('contacts', None)
       +        old_contacts = self.wallet.storage.get('contacts', [])
       +        if old_contacts:
       +            for k in set(old_contacts):
       +                l = self.wallet.labels.get(k)
       +                if bitcoin.is_address(k) and l:
       +                    self.contacts[l] = ('address', k)
       +            self.wallet.storage.put('contacts', None)
        
            def update_wallet_format(self):
                # convert old-format imported keys