add a lock to wallet.synchronize() and fix #1049
This commit is contained in:
parent
9e4eda24b5
commit
58f9ab3492
|
@ -251,6 +251,9 @@ class ElectrumWindow(QMainWindow):
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
traceback.print_exc(file=sys.stdout)
|
traceback.print_exc(file=sys.stdout)
|
||||||
self.show_message(str(e))
|
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):
|
def open_wallet(self):
|
||||||
|
|
|
@ -1203,8 +1203,9 @@ class Deterministic_Wallet(Abstract_Wallet):
|
||||||
self.save_accounts()
|
self.save_accounts()
|
||||||
|
|
||||||
def synchronize(self):
|
def synchronize(self):
|
||||||
for account in self.accounts.values():
|
with self.lock:
|
||||||
account.synchronize(self)
|
for account in self.accounts.values():
|
||||||
|
account.synchronize(self)
|
||||||
|
|
||||||
def restore(self, callback):
|
def restore(self, callback):
|
||||||
from i18n import _
|
from i18n import _
|
||||||
|
|
Loading…
Reference in New Issue