From a68bfab59624d489ab697b3d6b12af28ed6a53b9 Mon Sep 17 00:00:00 2001 From: f321x Date: Mon, 18 Aug 2025 10:03:24 +0200 Subject: [PATCH] swaps: improve preimage extraction logic --- electrum/submarine_swaps.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/electrum/submarine_swaps.py b/electrum/submarine_swaps.py index aa5399c50..9a968daf8 100644 --- a/electrum/submarine_swaps.py +++ b/electrum/submarine_swaps.py @@ -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]