mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-23 12:09:43 +00:00
re-enable tor
This commit is contained in:
parent
b95af3a649
commit
a34fe38e37
4 changed files with 29 additions and 29 deletions
|
@ -6,7 +6,7 @@ import 'package:hive/hive.dart';
|
||||||
import 'package:cw_core/hive_type_ids.dart';
|
import 'package:cw_core/hive_type_ids.dart';
|
||||||
import 'package:cw_core/wallet_type.dart';
|
import 'package:cw_core/wallet_type.dart';
|
||||||
import 'package:http/io_client.dart' as ioc;
|
import 'package:http/io_client.dart' as ioc;
|
||||||
// import 'package:tor/tor.dart';
|
import 'package:tor/tor.dart';
|
||||||
|
|
||||||
part 'node.g.dart';
|
part 'node.g.dart';
|
||||||
|
|
||||||
|
@ -220,9 +220,9 @@ class Node extends HiveObject with Keyable {
|
||||||
|
|
||||||
String? proxy = socksProxyAddress;
|
String? proxy = socksProxyAddress;
|
||||||
|
|
||||||
// if ((proxy?.isEmpty ?? true) && Tor.instance.enabled) {
|
if ((proxy?.isEmpty ?? true) && Tor.instance.enabled) {
|
||||||
// proxy = "${InternetAddress.loopbackIPv4.address}:${Tor.instance.port}";
|
proxy = "${InternetAddress.loopbackIPv4.address}:${Tor.instance.port}";
|
||||||
// }
|
}
|
||||||
if (proxy == null) {
|
if (proxy == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,10 +20,10 @@ dependencies:
|
||||||
intl: ^0.18.0
|
intl: ^0.18.0
|
||||||
encrypt: ^5.0.1
|
encrypt: ^5.0.1
|
||||||
socks5_proxy: ^1.0.4
|
socks5_proxy: ^1.0.4
|
||||||
# tor:
|
tor:
|
||||||
# git:
|
git:
|
||||||
# url: https://github.com/cake-tech/tor.git
|
url: https://github.com/cake-tech/tor.git
|
||||||
# ref: main
|
ref: main
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
|
|
|
@ -4,7 +4,7 @@ import 'dart:io';
|
||||||
import 'package:cake_wallet/src/screens/base_page.dart';
|
import 'package:cake_wallet/src/screens/base_page.dart';
|
||||||
import 'package:cake_wallet/store/app_store.dart';
|
import 'package:cake_wallet/store/app_store.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
// import 'package:tor/tor.dart';
|
import 'package:tor/tor.dart';
|
||||||
|
|
||||||
class TorPage extends BasePage {
|
class TorPage extends BasePage {
|
||||||
final AppStore appStore;
|
final AppStore appStore;
|
||||||
|
@ -40,22 +40,22 @@ class _TorPageBodyState extends State<TorPageBody> {
|
||||||
connecting = true; // Update flag
|
connecting = true; // Update flag
|
||||||
});
|
});
|
||||||
|
|
||||||
// await Tor.init();
|
await Tor.init();
|
||||||
//
|
|
||||||
// // Start the proxy
|
// Start the proxy
|
||||||
// await Tor.instance.start();
|
await Tor.instance.start();
|
||||||
//
|
|
||||||
// // Toggle started flag.
|
// Toggle started flag.
|
||||||
// setState(() {
|
setState(() {
|
||||||
// torEnabled = Tor.instance.enabled; // Update flag
|
torEnabled = Tor.instance.enabled; // Update flag
|
||||||
// connecting = false;
|
connecting = false;
|
||||||
// });
|
});
|
||||||
//
|
|
||||||
// final node = widget.appStore.settingsStore.getCurrentNode(widget.appStore.wallet!.type);
|
final node = widget.appStore.settingsStore.getCurrentNode(widget.appStore.wallet!.type);
|
||||||
// if (node.socksProxyAddress?.isEmpty ?? true) {
|
if (node.socksProxyAddress?.isEmpty ?? true) {
|
||||||
// node.socksProxyAddress = "${InternetAddress.loopbackIPv4.address}:${Tor.instance.port}";
|
node.socksProxyAddress = "${InternetAddress.loopbackIPv4.address}:${Tor.instance.port}";
|
||||||
// }
|
}
|
||||||
// widget.appStore.wallet!.connectToNode(node: node);
|
widget.appStore.wallet!.connectToNode(node: node);
|
||||||
|
|
||||||
print('Done awaiting; tor should be running');
|
print('Done awaiting; tor should be running');
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,10 +98,10 @@ dependencies:
|
||||||
url: https://github.com/cake-tech/bitcoin_flutter.git
|
url: https://github.com/cake-tech/bitcoin_flutter.git
|
||||||
ref: cake-update-v3
|
ref: cake-update-v3
|
||||||
fluttertoast: 8.1.4
|
fluttertoast: 8.1.4
|
||||||
# tor:
|
tor:
|
||||||
# git:
|
git:
|
||||||
# url: https://github.com/cake-tech/tor.git
|
url: https://github.com/cake-tech/tor.git
|
||||||
# ref: main
|
ref: main
|
||||||
socks5_proxy: ^1.0.4
|
socks5_proxy: ^1.0.4
|
||||||
flutter_svg: ^2.0.9
|
flutter_svg: ^2.0.9
|
||||||
polyseed:
|
polyseed:
|
||||||
|
|
Loading…
Reference in a new issue