Skip to content

Commit

Permalink
Merge pull request #9461 from f321x/fix_rswap_exception
Browse files Browse the repository at this point in the history
Handle reverse swap exception more gracefully
  • Loading branch information
accumulator authored Jan 20, 2025
2 parents 142f1d5 + 18d3d26 commit 08688c3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions electrum/gui/qt/swap_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,12 @@ def run(self, transport):
expected_onchain_amount_sat=onchain_amount + self.swap_manager.get_claim_fee(),
zeroconf=self.zeroconf,
)
# we must not leave the context, so we use run_couroutine_dialog
funding_txid = self.window.run_coroutine_dialog(coro, _('Initiating swap...'))
try:
# we must not leave the context, so we use run_couroutine_dialog
funding_txid = self.window.run_coroutine_dialog(coro, _('Initiating swap...'))
except Exception as e:
self.window.show_error(f"Reverse swap failed: {str(e)}")
return
self.window.on_swap_result(funding_txid, is_reverse=True)
return True
else:
Expand Down

0 comments on commit 08688c3

Please sign in to comment.