Skip to content

Commit

Permalink
SFT-3980: first pass at clarifying psbt fingerprint mismatch message
Browse files Browse the repository at this point in the history
  • Loading branch information
mjg-foundation committed Aug 12, 2024
1 parent 3cc4308 commit cafc0e9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions ports/stm32/boards/Passport/modules/psbt.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit cafc0e9

Please sign in to comment.