mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-06-28 20:39:51 +00:00
fix red indicator for XMR nodes
This commit is contained in:
parent
66d4b959af
commit
b90e610327
1 changed files with 13 additions and 23 deletions
|
@ -95,29 +95,19 @@ class Node extends HiveObject with Keyable {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<bool> requestMoneroNode() async {
|
Future<bool> requestMoneroNode() async {
|
||||||
return false;
|
try {
|
||||||
//try {
|
Map<String, dynamic> resBody;
|
||||||
// Map<String, dynamic> resBody;
|
final rpcUri = Uri.http(uri.authority, '/json_rpc');
|
||||||
|
final headers = {'Content-type': 'application/json'};
|
||||||
// if (login != null && password != null) {
|
final body =
|
||||||
// final digestRequest = DigestRequest();
|
json.encode({'jsonrpc': '2.0', 'id': '0', 'method': 'get_info'});
|
||||||
// final response = await digestRequest.request(
|
final response =
|
||||||
// uri: uri.toString(), login: login, password: password);
|
await http.post(rpcUri.toString(), headers: headers, body: body);
|
||||||
// resBody = response.data as Map<String, dynamic>;
|
resBody = json.decode(response.body) as Map<String, dynamic>;
|
||||||
// } else {
|
return !(resBody['result']['offline'] as bool);
|
||||||
// final rpcUri = Uri.http(uri.authority, '/json_rpc');
|
} catch (_) {
|
||||||
// final headers = {'Content-type': 'application/json'};
|
return false;
|
||||||
// final body =
|
}
|
||||||
// json.encode({'jsonrpc': '2.0', 'id': '0', 'method': 'get_info'});
|
|
||||||
// final response =
|
|
||||||
// await http.post(rpcUri.toString(), headers: headers, body: body);
|
|
||||||
// resBody = json.decode(response.body) as Map<String, dynamic>;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// return !(resBody['result']['offline'] as bool);
|
|
||||||
//} catch (_) {
|
|
||||||
// return false;
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<bool> requestElectrumServer() async {
|
Future<bool> requestElectrumServer() async {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue