fixes for hardware wallets
This commit is contained in:
@@ -356,7 +356,6 @@ class DeviceMgr(ThreadJob, PrintError):
|
|||||||
_id = self.xpub_ids.pop(xpub)
|
_id = self.xpub_ids.pop(xpub)
|
||||||
client = self.client_lookup(_id)
|
client = self.client_lookup(_id)
|
||||||
self.clients.pop(client, None)
|
self.clients.pop(client, None)
|
||||||
#wallet.unpaired()
|
|
||||||
if client:
|
if client:
|
||||||
client.close()
|
client.close()
|
||||||
|
|
||||||
@@ -369,7 +368,6 @@ class DeviceMgr(ThreadJob, PrintError):
|
|||||||
def pair_xpub(self, xpub, id_):
|
def pair_xpub(self, xpub, id_):
|
||||||
with self.lock:
|
with self.lock:
|
||||||
self.xpub_ids[xpub] = id_
|
self.xpub_ids[xpub] = id_
|
||||||
#wallet.paired()
|
|
||||||
|
|
||||||
def client_lookup(self, id_):
|
def client_lookup(self, id_):
|
||||||
with self.lock:
|
with self.lock:
|
||||||
@@ -407,7 +405,8 @@ class DeviceMgr(ThreadJob, PrintError):
|
|||||||
def force_pair_xpub(self, plugin, handler, xpub, derivation, devices):
|
def force_pair_xpub(self, plugin, handler, xpub, derivation, devices):
|
||||||
# The wallet has not been previously paired, so let the user
|
# The wallet has not been previously paired, so let the user
|
||||||
# choose an unpaired device and compare its first address.
|
# 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_)
|
client = self.client_lookup(info.device.id_)
|
||||||
if client and client.is_pairable():
|
if client and client.is_pairable():
|
||||||
# See comment above for same code
|
# See comment above for same code
|
||||||
|
|||||||
@@ -48,7 +48,6 @@ class HW_PluginBase(BasePlugin):
|
|||||||
|
|
||||||
@hook
|
@hook
|
||||||
def close_wallet(self, wallet):
|
def close_wallet(self, wallet):
|
||||||
keystore = wallet.get_keystore()
|
for keystore in wallet.get_keystores():
|
||||||
if isinstance(keystore, self.keystore_class):
|
if isinstance(keystore, self.keystore_class):
|
||||||
self.device_manager().unpair_xpub(keystore.xpub)
|
self.device_manager().unpair_xpub(keystore.xpub)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user