1
0

hw_wallet: don't make watching only if cannot pair

Instead issue a warning.  Being watching-only disables
various functionality that should instead just ask again
for the PIN to be input.
This commit is contained in:
Neil Booth
2016-02-07 17:16:29 +09:00
parent bb3de0eb63
commit 9490debf0f
6 changed files with 15 additions and 26 deletions

View File

@@ -392,14 +392,22 @@ class DeviceMgr(PrintError):
# See comment above for same code
client.handler = wallet.handler
# This will trigger a PIN/passphrase entry request
client_first_address = client.first_address(derivation)
try:
client_first_address = client.first_address(derivation)
except (UserCancelled, RuntimeError):
# Bad / cancelled PIN / passphrase
client_first_address = None
if client_first_address == first_address:
self.pair_wallet(wallet, info.device.id_)
return client
# The user input has wrong PIN or passphrase, or it is not pairable
# The user input has wrong PIN or passphrase, or cancelled input,
# or it is not pairable
raise DeviceUnpairableError(
_('Unable to pair with your %s.') % plugin.device)
_('Unable to pair with your %s.\n\n'
'Ensure you are able to pair it, or you have the seed phrase, '
'before you request bitcoins to be sent to this wallet.'
) % plugin.device)
def unpaired_device_infos(self, handler, plugin, devices=None):
'''Returns a list of DeviceInfo objects: one for each connected,