checkConnections method

Future<List<UrlConnection>> checkConnections()

Checks the status of XMR connections from the server.

This method sends a CheckConnectionsRequest to check the status of all XMR connections from the Haveno gRPC server.

Example:

final connections = await xmrConnectionsClient.checkConnections();
for (final connection in connections) {
  print('Connection Status: ${connection.onlineStatus}');
}

Returns:

  • A Future containing a list of UrlConnection.
  • An empty list if an error occurs.

Implementation

Future<List<UrlConnection>> checkConnections() async {
  if (!havenoChannel.isConnected) {
    throw DaemonNotConnectedException();
  }
  try {
    final response = await havenoChannel.xmrConnectionsClient!
        .checkConnections(CheckConnectionsRequest());
    return response.connections;
  } on GrpcError catch (e) {
    handleGrpcError(e);
  }
  return [];
}