1
0

swaps: improve preimage extraction logic

This commit is contained in:
f321x
2025-08-18 10:03:24 +02:00
parent 4c6d8166a4
commit a68bfab596

View File

@@ -384,7 +384,7 @@ class SwapManager(Logger):
def extract_preimage(cls, swap: SwapData, claim_tx: Transaction) -> Optional[bytes]:
for txin in claim_tx.inputs():
witness = txin.witness_elements()
if not witness:
if not witness or len(witness) < 2:
# tx may be unsigned
continue
preimage = witness[1]