mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-11-17 17:57:40 +00:00
fix: (ba)nano testNetworkConnection always returning false
This commit is contained in:
parent
479b0b333d
commit
cb1922d2c7
2 changed files with 8 additions and 18 deletions
|
@ -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;
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue