add a lock to wallet.synchronize() and fix #1049

This commit is contained in:
ThomasV 2015-03-13 16:51:31 +01:00
parent 9e4eda24b5
commit 58f9ab3492
2 changed files with 6 additions and 2 deletions

View File

@ -251,6 +251,9 @@ class ElectrumWindow(QMainWindow):
except Exception as e:
traceback.print_exc(file=sys.stdout)
self.show_message(str(e))
# call synchronize to regenerate addresses in case we are offline
if self.wallet.get_master_public_keys() and self.wallet.addresses() == []:
self.wallet.synchronize()
def open_wallet(self):

View File

@ -1203,8 +1203,9 @@ class Deterministic_Wallet(Abstract_Wallet):
self.save_accounts()
def synchronize(self):
for account in self.accounts.values():
account.synchronize(self)
with self.lock:
for account in self.accounts.values():
account.synchronize(self)
def restore(self, callback):
from i18n import _