diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py index f9dd8cbf..32a57bfc 100644 --- a/gui/qt/main_window.py +++ b/gui/qt/main_window.py @@ -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): diff --git a/lib/wallet.py b/lib/wallet.py index 2063be31..b576ba19 100644 --- a/lib/wallet.py +++ b/lib/wallet.py @@ -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 _