Skip to content

Commit

Permalink
commands.py: use fingerprint if already captured by client
Browse files Browse the repository at this point in the history
  • Loading branch information
doc-hex committed Apr 29, 2019
1 parent c628206 commit 0cf6bb9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions hwilib/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,12 @@ def find_device(device_path, password='', device_type=None, fingerprint=None):
client = None
try:
client = get_client(d['type'], d['path'], password)
master_xpub = client.get_pubkey_at_path('m/0h')['xpub']
master_fpr = get_xpub_fingerprint_hex(master_xpub)

master_fpr = d.get('fingerprint', None)
if master_fpr is None:
master_xpub = client.get_pubkey_at_path('m/0h')['xpub']
master_fpr = get_xpub_fingerprint_hex(master_xpub)

if fingerprint and master_fpr != fingerprint:
client.close()
continue
Expand Down

0 comments on commit 0cf6bb9

Please sign in to comment.