From 0c831e4f75095827f8153feeaa670f618fe162f3 Mon Sep 17 00:00:00 2001 From: "Peter D. Gray" Date: Mon, 29 Apr 2019 10:32:58 -0400 Subject: [PATCH] devices/coldcard.py: accelerate enum process by using fingerprint value revealed during connection setup --- hwilib/devices/coldcard.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/hwilib/devices/coldcard.py b/hwilib/devices/coldcard.py index c989e5e..6fe8912 100644 --- a/hwilib/devices/coldcard.py +++ b/hwilib/devices/coldcard.py @@ -14,6 +14,8 @@ import hid import io import sys import time +import struct +from binascii import hexlify CC_SIMULATOR_SOCK = '/tmp/ckcc-simulator.sock' # Using the simulator: https://github.com/Coldcard/firmware/blob/master/unix/README.md @@ -56,6 +58,10 @@ class ColdcardClient(HardwareWalletClient): else: return {'xpub':xpub} + def _get_fingerprint_hex(self): + # quick method to get fingerprint of wallet + return hexlify(struct.pack('