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

This commit is contained in:
binarybaron 2024-11-26 17:55:17 +01:00 committed by GitHub
parent 82631a39d7
commit 72d324780e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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 {