fix: red dot in non ssl nodes

This commit is contained in:
Rafael Saes 2024-04-09 19:38:39 -03:00
parent fa5effd0cc
commit 0777db81c7

View file

@ -232,8 +232,12 @@ class Node extends HiveObject with Keyable {
Future<bool> requestElectrumServer() async {
try {
await SecureSocket.connect(uri.host, uri.port,
timeout: Duration(seconds: 5), onBadCertificate: (_) => true);
if (useSSL == true) {
await SecureSocket.connect(uri.host, uri.port,
timeout: Duration(seconds: 5), onBadCertificate: (_) => true);
} else {
await Socket.connect(uri.host, uri.port, timeout: Duration(seconds: 5));
}
return true;
} catch (_) {
return false;