Only write wallet if necessary
This commit is contained in:
parent
084a352456
commit
c64e8b9885
@ -282,12 +282,13 @@ class ElectrumWindow(QMainWindow, PrintError):
|
|||||||
|
|
||||||
def import_old_contacts(self):
|
def import_old_contacts(self):
|
||||||
# backward compatibility: import contacts
|
# backward compatibility: import contacts
|
||||||
addressbook = set(self.wallet.storage.get('contacts', []))
|
old_contacts = self.wallet.storage.get('contacts', [])
|
||||||
for k in addressbook:
|
if old_contacts:
|
||||||
l = self.wallet.labels.get(k)
|
for k in set(old_contacts):
|
||||||
if bitcoin.is_address(k) and l:
|
l = self.wallet.labels.get(k)
|
||||||
self.contacts[l] = ('address', k)
|
if bitcoin.is_address(k) and l:
|
||||||
self.wallet.storage.put('contacts', None)
|
self.contacts[l] = ('address', k)
|
||||||
|
self.wallet.storage.put('contacts', None)
|
||||||
|
|
||||||
def update_wallet_format(self):
|
def update_wallet_format(self):
|
||||||
# convert old-format imported keys
|
# convert old-format imported keys
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user