From cafc0e9396969a3bd10832a5a882cc1fb6b35bc1 Mon Sep 17 00:00:00 2001 From: Matt Gleason Date: Mon, 12 Aug 2024 13:51:05 -0400 Subject: [PATCH] SFT-3980: first pass at clarifying psbt fingerprint mismatch message --- ports/stm32/boards/Passport/modules/psbt.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ports/stm32/boards/Passport/modules/psbt.py b/ports/stm32/boards/Passport/modules/psbt.py index 00e373057..93b2d6fa5 100644 --- a/ports/stm32/boards/Passport/modules/psbt.py +++ b/ports/stm32/boards/Passport/modules/psbt.py @@ -268,6 +268,7 @@ def parse_subpaths(self, my_xfp): # update in place self.subpaths[pk] = here + print("subpath my_xfp: {}".format(xfp2str(my_xfp))) if here[0] == my_xfp or here[0] == swab32(my_xfp): num_ours += 1 else: @@ -299,6 +300,7 @@ def parse_subpaths(self, my_xfp): # update in place self.tap_subpaths[pk] = (here, tap_hashes) + print("tap subpath my_xfp: {}".format(xfp2str(my_xfp))) if here[0] == my_xfp or here[0] == swab32(my_xfp): num_ours += 1 else: @@ -935,6 +937,7 @@ def __init__(self): from common import settings self.my_xfp = settings.get('xfp', 0) + print("psbtObject xfp: {}".format(xfp2str(self.my_xfp))) # details that we discover as we go self.inputs = None @@ -1467,9 +1470,9 @@ def consider_keys(self): others.discard(self.my_xfp) msg = ', '.join(xfp2str(i) for i in others) - raise FatalPSBTIssue('None of the keys involved in this transaction ' - 'belong to this Passport (need %s, found %s).' - % (xfp2str(self.my_xfp), msg)) + raise FatalPSBTIssue('This transaction can be signed by these wallets: %s,' + 'but this passport has fingerprint %s.' + % (msg, xfp2str(self.my_xfp))) @classmethod def read_psbt(cls, fd):