fix: (ba)nano testNetworkConnection always returning false

This commit is contained in:
julian 2023-06-07 12:28:11 -06:00
parent 479b0b333d
commit cb1922d2c7
2 changed files with 8 additions and 18 deletions

View file

@ -756,15 +756,10 @@ class BananoWallet extends CoinServiceAPI
} }
@override @override
Future<bool> testNetworkConnection() { Future<bool> testNetworkConnection() async {
http final uri = Uri.parse("${getCurrentNode().host}?action=version");
.get(Uri.parse("${getCurrentNode().host}?action=version")) final response = await http.get(uri);
.then((response) { return response.statusCode == 200;
if (response.statusCode == 200) {
return true;
}
});
return Future.value(false);
} }
Timer? _networkAliveTimer; Timer? _networkAliveTimer;

View file

@ -775,15 +775,10 @@ class NanoWallet extends CoinServiceAPI
} }
@override @override
Future<bool> testNetworkConnection() { Future<bool> testNetworkConnection() async {
http final uri = Uri.parse("${getCurrentNode().host}?action=version");
.get(Uri.parse("${getCurrentNode().host}?action=version")) final response = await http.get(uri);
.then((response) { return response.statusCode == 200;
if (response.statusCode == 200) {
return true;
}
});
return Future.value(false);
} }
Timer? _networkAliveTimer; Timer? _networkAliveTimer;