Browse Source

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

master
ThomasV 11 years ago
parent
commit
58f9ab3492
  1. 3
      gui/qt/main_window.py
  2. 5
      lib/wallet.py

3
gui/qt/main_window.py

@ -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):

5
lib/wallet.py

@ -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…
Cancel
Save