Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(gui): Only refund swaps in the background that haven't been refunded yet #212

Merged
merged 1 commit into from
Nov 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading