Skip to content

Commit 7338eb2

Browse files
committed
fix: move re resubscribe to after outspend check
1 parent 9863b4b commit 7338eb2

1 file changed

Lines changed: 16 additions & 16 deletions

File tree

lib/core/swaps/data/services/swap_watcher.dart

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,6 @@ class SwapWatcherService {
190190
);
191191
await _boltzRepo.updateSwap(swap: updatedSwap);
192192
} catch (e, st) {
193-
// Re-subscribe on error so watcher continues monitoring
194-
_boltzRepo.subscribeToSwaps([swap.id]);
195193
log.severe(error: e, trace: st);
196194

197195
// Check if transaction actually succeeded despite the error
@@ -203,6 +201,8 @@ class SwapWatcherService {
203201
);
204202
if (recovered) return;
205203

204+
// Re-subscribe on error so watcher continues monitoring
205+
_boltzRepo.subscribeToSwaps([swap.id]);
206206
rethrow;
207207
}
208208
}
@@ -254,8 +254,6 @@ class SwapWatcherService {
254254
await _boltzRepo.updateSwap(swap: updatedSwap);
255255
_swapStreamController.add(updatedSwap);
256256
} catch (e, st) {
257-
// Re-subscribe on error so watcher continues monitoring
258-
_boltzRepo.subscribeToSwaps([swap.id]);
259257
log.severe(error: e, trace: st);
260258

261259
// Check if transaction actually succeeded despite the error
@@ -267,6 +265,8 @@ class SwapWatcherService {
267265
);
268266
if (recovered) return;
269267

268+
// Re-subscribe on error so watcher continues monitoring
269+
_boltzRepo.subscribeToSwaps([swap.id]);
270270
rethrow;
271271
}
272272
}
@@ -420,8 +420,6 @@ class SwapWatcherService {
420420
);
421421
await _boltzRepo.updateSwap(swap: updatedSwap);
422422
} catch (e, st) {
423-
// Re-subscribe on error so watcher continues monitoring
424-
_boltzRepo.subscribeToSwaps([swap.id]);
425423
log.severe(error: e, trace: st);
426424

427425
// Check if transaction actually succeeded despite the error
@@ -433,6 +431,8 @@ class SwapWatcherService {
433431
);
434432
if (recovered) return;
435433

434+
// Re-subscribe on error so watcher continues monitoring
435+
_boltzRepo.subscribeToSwaps([swap.id]);
436436
rethrow;
437437
}
438438
}
@@ -510,8 +510,6 @@ class SwapWatcherService {
510510
);
511511
await _boltzRepo.updateSwap(swap: updatedSwap);
512512
} catch (e, st) {
513-
// Re-subscribe on error so watcher continues monitoring
514-
_boltzRepo.subscribeToSwaps([swap.id]);
515513
log.severe(error: e, trace: st);
516514

517515
// Check if transaction actually succeeded despite the error
@@ -523,6 +521,8 @@ class SwapWatcherService {
523521
);
524522
if (recovered) return;
525523

524+
// Re-subscribe on error so watcher continues monitoring
525+
_boltzRepo.subscribeToSwaps([swap.id]);
526526
rethrow;
527527
}
528528
}
@@ -596,8 +596,6 @@ class SwapWatcherService {
596596
);
597597
await _boltzRepo.updateSwap(swap: updatedSwap);
598598
} catch (e, st) {
599-
// Re-subscribe on error so watcher continues monitoring
600-
_boltzRepo.subscribeToSwaps([swap.id]);
601599
log.severe(error: e, trace: st);
602600

603601
// Check if transaction actually succeeded despite the error
@@ -609,6 +607,8 @@ class SwapWatcherService {
609607
);
610608
if (recovered) return;
611609

610+
// Re-subscribe on error so watcher continues monitoring
611+
_boltzRepo.subscribeToSwaps([swap.id]);
612612
rethrow;
613613
}
614614
}
@@ -684,8 +684,6 @@ class SwapWatcherService {
684684
);
685685
await _boltzRepo.updateSwap(swap: updatedSwap);
686686
} catch (e, st) {
687-
// Re-subscribe on error so watcher continues monitoring
688-
_boltzRepo.subscribeToSwaps([swap.id]);
689687
log.severe(error: e, trace: st);
690688

691689
// Check if transaction actually succeeded despite the error
@@ -697,6 +695,8 @@ class SwapWatcherService {
697695
);
698696
if (recovered) return;
699697

698+
// Re-subscribe on error so watcher continues monitoring
699+
_boltzRepo.subscribeToSwaps([swap.id]);
700700
rethrow;
701701
}
702702
}
@@ -779,8 +779,6 @@ class SwapWatcherService {
779779
);
780780
await _boltzRepo.updateSwap(swap: updatedSwap);
781781
} catch (e, st) {
782-
// Re-subscribe on error so watcher continues monitoring
783-
_boltzRepo.subscribeToSwaps([swap.id]);
784782
log.severe(error: e, trace: st);
785783

786784
// Check if transaction actually succeeded despite the error
@@ -792,6 +790,8 @@ class SwapWatcherService {
792790
);
793791
if (recovered) return;
794792

793+
// Re-subscribe on error so watcher continues monitoring
794+
_boltzRepo.subscribeToSwaps([swap.id]);
795795
rethrow;
796796
}
797797
}
@@ -871,8 +871,6 @@ class SwapWatcherService {
871871
);
872872
await _boltzRepo.updateSwap(swap: updatedSwap);
873873
} catch (e, st) {
874-
// Re-subscribe on error so watcher continues monitoring
875-
_boltzRepo.subscribeToSwaps([swap.id]);
876874
log.severe(error: e, trace: st);
877875

878876
// Check if transaction actually succeeded despite the error
@@ -884,6 +882,8 @@ class SwapWatcherService {
884882
);
885883
if (recovered) return;
886884

885+
// Re-subscribe on error so watcher continues monitoring
886+
_boltzRepo.subscribeToSwaps([swap.id]);
887887
rethrow;
888888
}
889889
}

0 commit comments

Comments
 (0)