1
0

fix user-facing exception refreshing history after swap is refunded

(txbatcher first adds the tx unsigned)
This commit is contained in:
ThomasV
2025-06-10 10:44:04 +02:00
parent 15e77d2d80
commit 86f3eec8e6

View File

@@ -367,7 +367,11 @@ class SwapManager(Logger):
@classmethod
def extract_preimage(cls, swap: SwapData, claim_tx: Transaction) -> Optional[bytes]:
for txin in claim_tx.inputs():
preimage = txin.witness_elements()[1]
witness = txin.witness_elements()
if not witness:
# tx may be unsigned
continue
preimage = witness[1]
if sha256(preimage) == swap.payment_hash:
return preimage
return None