1
0

hardware wallets: pass xtype to get_xpub

This commit is contained in:
ThomasV
2017-10-31 11:45:25 +01:00
parent 1ecfcea8dc
commit f36024e216
8 changed files with 26 additions and 34 deletions

View File

@@ -34,6 +34,7 @@ import threading
from .util import *
from .i18n import _
from .util import profiler, PrintError, DaemonThread, UserCancelled, ThreadJob
from . import bitcoin
plugin_loaders = {}
hook_names = set()
@@ -421,14 +422,14 @@ class DeviceMgr(ThreadJob, PrintError):
def force_pair_xpub(self, plugin, handler, info, xpub, derivation, devices):
# The wallet has not been previously paired, so let the user
# choose an unpaired device and compare its first address.
xtype = bitcoin.xpub_type(xpub)
client = self.client_lookup(info.device.id_)
if client and client.is_pairable():
# See comment above for same code
client.handler = handler
# This will trigger a PIN/passphrase entry request
try:
client_xpub = client.get_xpub(derivation)
client_xpub = client.get_xpub(derivation, xtype)
except (UserCancelled, RuntimeError):
# Bad / cancelled PIN / passphrase
client_xpub = None