Browse Source

Bugfix: correct check of receiver inputs in BIP78

Before this commit, the check of receiver inputs in the
proposed PSBT from the receiver was erroneously failing,
if the number of sender inputs was greater than 1, because
the list of receiver input indices was not populated correctly
before the check. This commit fixes this bug.
master
Adam Gibson 5 years ago
parent
commit
dc4a5b260e
No known key found for this signature in database
GPG Key ID: 141001A1AF77F20B
  1. 6
      jmclient/jmclient/payjoin.py

6
jmclient/jmclient/payjoin.py

@ -295,8 +295,10 @@ class JMPayjoinManager(object):
for j, inp2 in enumerate(ourins):
if (inp.prevout.hash, inp.prevout.n) == inp2:
found[j] += 1
else:
receiver_input_indices.append(i)
break
else:
receiver_input_indices.append(i)
assert len(receiver_input_indices) + len(ourins) == len(in_psbt.unsigned_tx.vin)
if any([f != 1 for f in found]):
return (False, "Receiver proposed PSBT does not contain our inputs.")

Loading…
Cancel
Save