From 412e2a8d2c505342f790f6dc8ae15df2c745321a Mon Sep 17 00:00:00 2001 From: Neil Booth Date: Fri, 29 Jan 2016 19:26:05 +0900 Subject: [PATCH] Create is_pairable() function and use it. Fixes #1653. --- lib/plugins.py | 2 +- plugins/trezor/clientbase.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/plugins.py b/lib/plugins.py index 9d806b52..a362c8f3 100644 --- a/lib/plugins.py +++ b/lib/plugins.py @@ -376,7 +376,7 @@ class DeviceMgr(PrintError): info = self.select_device(wallet, plugin, devices) if info: client = self.client_lookup(info.device.id_) - if client and not client.features.bootloader_mode: + if client and client.is_pairable(): # See comment above for same code client.handler = wallet.handler # This will trigger a PIN/passphrase entry request diff --git a/plugins/trezor/clientbase.py b/plugins/trezor/clientbase.py index 0bf9d38e..2bbf247f 100644 --- a/plugins/trezor/clientbase.py +++ b/plugins/trezor/clientbase.py @@ -94,6 +94,9 @@ class TrezorClientBase(GuiMixin, PrintError): '''True if initialized, False if wiped.''' return self.features.initialized + def is_pairable(self): + return not client.features.bootloader_mode + @staticmethod def expand_path(n): '''Convert bip32 path to list of uint32 integers with prime flags