Skip to content

Commit ca0e12b

Browse files
committed
fir tor background sync (will work on test builds after #2142 is merged and this PR is rebased on top)
1 parent 2d25164 commit ca0e12b

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.github/workflows/no_http_imports.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
- name: Check for http package usage
1212
if: github.event_name == 'pull_request'
1313
run: |
14-
GIT_GREP_OUT="$(git grep package:http | (grep .dart: || test $? = 1) || true)"
14+
GIT_GREP_OUT="$(git grep package:http | (grep .dart: || test $? = 1) | (grep -v proxy_wrapper.dart || test $? = 1) || true)"
1515
[[ "x$GIT_GREP_OUT" == "x" ]] && exit 0
1616
echo "$GIT_GREP_OUT"
1717
echo "There are .dart files which use http imports"

lib/core/background_sync.dart

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import 'package:cake_wallet/core/key_service.dart';
44
import 'package:cake_wallet/core/wallet_loading_service.dart';
55
import 'package:cake_wallet/di.dart';
66
import 'package:cake_wallet/store/settings_store.dart';
7+
import 'package:cake_wallet/utils/tor.dart';
78
import 'package:cake_wallet/view_model/wallet_list/wallet_list_item.dart';
89
import 'package:cake_wallet/view_model/wallet_list/wallet_list_view_model.dart';
910
import 'package:cw_core/sync_status.dart';
@@ -13,6 +14,11 @@ import 'package:flutter/foundation.dart';
1314

1415
class BackgroundSync {
1516
Future<void> sync() async {
17+
final settingsStore = getIt.get<SettingsStore>();
18+
if (settingsStore.currentBuiltinTor) {
19+
printV("Starting Tor");
20+
await ensureTorStarted(context: null);
21+
}
1622
printV("Background sync started");
1723
await _syncMonero();
1824
printV("Background sync completed");
@@ -23,7 +29,6 @@ class BackgroundSync {
2329
final walletListViewModel = getIt.get<WalletListViewModel>();
2430
final settingsStore = getIt.get<SettingsStore>();
2531

26-
2732
final List<WalletListItem> moneroWallets = walletListViewModel.wallets
2833
.where((element) => !element.isHardware)
2934
.where((element) => [WalletType.monero].contains(element.type))

0 commit comments

Comments
 (0)