Skip to content

Commit

Permalink
Added delay only for liquid claim (requires time to allow mempool pro…
Browse files Browse the repository at this point in the history
…pogation - removed delays for refund and bitcoin claim
  • Loading branch information
i5hi committed May 3, 2024
1 parent 3587a88 commit 0685715
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion lib/_pkg/boltz/swap.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import 'package:bb_mobile/_pkg/error.dart';
import 'package:bb_mobile/_pkg/storage/secure_storage.dart';
import 'package:bb_mobile/_pkg/storage/storage.dart';
import 'package:boltz_dart/boltz_dart.dart';
import 'package:flutter_animate/flutter_animate.dart';

class SwapBoltz {
SwapBoltz({
Expand Down Expand Up @@ -439,7 +440,7 @@ class SwapBoltz {
if (claimFeesEstimate == null) throw 'Fees estimate not found';

final swap = swapTx.toLbtcLnV2Swap(swapSensitive);

Future.delayed(17.seconds);
final resp = await swap.claim(
outAddress: address,
absFee: claimFeesEstimate,
Expand Down
6 changes: 3 additions & 3 deletions lib/swap/bloc/watchtxs_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ class WatchTxsBloc extends Bloc<WatchTxsEvent, WatchTxsState> {
),
);

await Future.delayed(10.seconds);
// await Future.delayed(10.seconds);

final (txid, err) = await _swapBoltz.refundV2SubmarineSwap(
swapTx: swapTx,
Expand Down Expand Up @@ -267,7 +267,7 @@ class WatchTxsBloc extends Bloc<WatchTxsEvent, WatchTxsState> {
),
);

await Future.delayed(10.seconds);
// await Future.delayed(10.seconds);

final (txid, err) = await _swapBoltz.claimV2ReverseSwap(
swapTx: swapTx,
Expand Down Expand Up @@ -331,7 +331,7 @@ class WatchTxsBloc extends Bloc<WatchTxsEvent, WatchTxsState> {
),
);

await Future.delayed(10.seconds);
await Future.delayed(7.seconds);

final err = await _swapBoltz.cooperativeSubmarineClose(
swapTx: swapTx,
Expand Down

0 comments on commit 0685715

Please sign in to comment.