Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Monero fixes: tor (do not prepend https:// for .onion domains on mobile) and SWBs (init restored wallets as rescan) #967

Merged
merged 4 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,13 @@ abstract class SWB {
privateKey: privateKey,
);

await wallet.init();
if (wallet is MoneroWallet /*|| wallet is WowneroWallet doesn't work.*/) {
await wallet.init(isRestore: true);
} else if (wallet is WowneroWallet) {
await wallet.init(isRestore: true);
} else {
await wallet.init();
}

int restoreHeight = walletbackup['restoreHeight'] as int? ?? 0;
if (restoreHeight <= 0) {
Expand Down
2 changes: 1 addition & 1 deletion lib/utilities/test_monero_node_connection.dart
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ Future<MoneroNodeConnectionResponse> testMoneroNodeConnection(

final response = await request.close();
final result = await response.transform(utf8.decoder).join();
print("HTTP Response: $result");
// print("HTTP Response: $result");

final success =
result.contains('"result":') && !result.contains('"error"');
Expand Down
12 changes: 1 addition & 11 deletions lib/utilities/test_node_connection.dart
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ Future<bool> testNodeConnection({
final url = formData.host!;
final uri = Uri.tryParse(url);
if (uri != null) {
if (!uri.hasScheme) {
if (!uri.hasScheme && !uri.host.endsWith(".onion")) {
// try https first
testPassed = await _xmrHelper(
formData
Expand All @@ -136,16 +136,6 @@ Future<bool> testNodeConnection({
proxyInfo,
);
}
} else if (!uri.hasScheme && uri.host.endsWith(".onion")) {
// We can just test http for onion addresses.
testPassed = await _xmrHelper(
formData
..host = url
..useSSL = false,
context,
onSuccess,
proxyInfo,
);
} else {
testPassed = await _xmrHelper(
formData
Expand Down
Loading