tfixes for hardware wallets - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit 6b0e65fc0a42af7e37b082e1f2eccb2fb5eb8bdd DIR parent 665d1bc153a41b922e87f17337d81cd004acb2ec HTML Author: ThomasV <thomasv@electrum.org> Date: Wed, 24 Aug 2016 19:37:29 +0200 fixes for hardware wallets Diffstat: M lib/plugins.py | 5 ++--- M plugins/hw_wallet/plugin.py | 7 +++---- 2 files changed, 5 insertions(+), 7 deletions(-) --- DIR diff --git a/lib/plugins.py b/lib/plugins.py t@@ -356,7 +356,6 @@ class DeviceMgr(ThreadJob, PrintError): _id = self.xpub_ids.pop(xpub) client = self.client_lookup(_id) self.clients.pop(client, None) - #wallet.unpaired() if client: client.close() t@@ -369,7 +368,6 @@ class DeviceMgr(ThreadJob, PrintError): def pair_xpub(self, xpub, id_): with self.lock: self.xpub_ids[xpub] = id_ - #wallet.paired() def client_lookup(self, id_): with self.lock: t@@ -407,7 +405,8 @@ class DeviceMgr(ThreadJob, PrintError): def force_pair_xpub(self, plugin, handler, xpub, derivation, devices): # The wallet has not been previously paired, so let the user # choose an unpaired device and compare its first address. - info = self.select_device(handler, plugin, devices) + with self.lock: + info = self.select_device(handler, plugin, devices) client = self.client_lookup(info.device.id_) if client and client.is_pairable(): # See comment above for same code DIR diff --git a/plugins/hw_wallet/plugin.py b/plugins/hw_wallet/plugin.py t@@ -48,7 +48,6 @@ class HW_PluginBase(BasePlugin): @hook def close_wallet(self, wallet): - keystore = wallet.get_keystore() - if isinstance(keystore, self.keystore_class): - self.device_manager().unpair_xpub(keystore.xpub) - + for keystore in wallet.get_keystores(): + if isinstance(keystore, self.keystore_class): + self.device_manager().unpair_xpub(keystore.xpub)