electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit 58f9ab3492dfb9f7401f92db6b75f97819e1e5d8
parent 9e4eda24b5d2e25655a7be72e5ecb495c25c22c8
Author: ThomasV <thomasv@gitorious>
Date:   Fri, 13 Mar 2015 16:51:31 +0100

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

Diffstat:
Mgui/qt/main_window.py | 3+++
Mlib/wallet.py | 5+++--
2 files changed, 6 insertions(+), 2 deletions(-)

diff --git 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 @@ -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 _