fix user-facing exception refreshing history after swap is refunded
(txbatcher first adds the tx unsigned)
This commit is contained in:
@@ -367,7 +367,11 @@ class SwapManager(Logger):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def extract_preimage(cls, swap: SwapData, claim_tx: Transaction) -> Optional[bytes]:
|
def extract_preimage(cls, swap: SwapData, claim_tx: Transaction) -> Optional[bytes]:
|
||||||
for txin in claim_tx.inputs():
|
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:
|
if sha256(preimage) == swap.payment_hash:
|
||||||
return preimage
|
return preimage
|
||||||
return None
|
return None
|
||||||
|
|||||||
Reference in New Issue
Block a user