diff --git a/lib/electrumx_rpc/electrumx_client.dart b/lib/electrumx_rpc/electrumx_client.dart index bddce3289..719f4bb59 100644 --- a/lib/electrumx_rpc/electrumx_client.dart +++ b/lib/electrumx_rpc/electrumx_client.dart @@ -525,13 +525,21 @@ class ElectrumXClient { /// Returns true if ping succeeded Future ping({String? requestID, int retryCount = 1}) async { try { + // This doesn't work because electrum_adapter only returns the result + // (which is always `null`). + // await checkElectrumAdapter(); + // final response = await electrumAdapterClient! + // .ping() + // .timeout(const Duration(seconds: 2)); + // return (response as Map).isNotEmpty; + final response = await request( requestID: requestID, command: 'server.ping', requestTimeout: const Duration(seconds: 2), retries: retryCount, ).timeout(const Duration(seconds: 2)) as Map; - return response.isNotEmpty; // TODO [prio=extreme]: Fix this. + return response.isNotEmpty; } catch (e) { rethrow; }