Add sanity check.

This commit is contained in:
tecnovert 2024-10-29 19:59:12 +02:00
parent 2296198b44
commit 602682a2f4
No known key found for this signature in database
GPG key ID: 8ED6D8750C4E3F93

View file

@ -82,6 +82,8 @@ def recoverNoScriptTxnWithKey(self, bid_id: bytes, encoded_key, session=None):
raise ValueError('Provided key matches local key')
vkbs = ci_follower.sumKeys(kbsl, kbsf)
ensure(ci_follower.verifyPubkey(xmr_swap.pkbs), 'Invalid pkbs') # Sanity check
# Ensure summed key matches the expected pubkey
summed_pkbs = ci_follower.getPubkey(vkbs)
if (summed_pkbs != xmr_swap.pkbs):