Skip to content

Commit

Permalink
fix(gui): Only refund swaps in the background that haven't been refun…
Browse files Browse the repository at this point in the history
…ded yet
  • Loading branch information
binarybaron committed Nov 26, 2024
1 parent 82631a3 commit 2aedc31
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions swap/src/cli/watcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ impl Watcher {

// If the swap has to be refunded, do it in the background
if let Some(ExpiredTimelocks::Cancel { .. }) = new_timelock_status {
// If the swap is already refunded, we can skip the refund
if matches!(state, BobState::BtcRefunded(_)) {
continue;
}

// If the swap is already running, we can skip the refund
// The refund will be handled by the state machine
if let Some(current_swap_id) = self.swap_lock.get_current_swap_id().await {
Expand Down

0 comments on commit 2aedc31

Please sign in to comment.