1
0

swaps: cleanup after successful swap

unregister hold invoice callback and delete payment bundle. they are not
used anymore.
This commit is contained in:
f321x
2025-08-22 12:52:43 +02:00
parent c623cca654
commit 97a0d27fa6

View File

@@ -439,8 +439,12 @@ class SwapManager(Logger):
if spent_height > 0:
if current_height - spent_height > REDEEM_AFTER_DOUBLE_SPENT_DELAY:
self.logger.info(f'stop watching swap {swap.lockup_address}')
self.lnwatcher.remove_callback(swap.lockup_address)
swap.is_redeemed = True
# cleanup
self.lnwatcher.remove_callback(swap.lockup_address)
if not swap.is_reverse:
self.lnworker.delete_payment_bundle(swap.payment_hash)
self.lnworker.unregister_hold_invoice(swap.payment_hash)
if not swap.is_reverse:
if swap.preimage is None and spent_height is not None: