diff --git a/config/indexer_endpoints.json b/config/indexer_endpoints.json index d283564..b5e967e 100644 --- a/config/indexer_endpoints.json +++ b/config/indexer_endpoints.json @@ -1,4 +1,3 @@ [ - "https://gdev-indexer.p2p.legal", "https://hasura.gdev.coinduf.eu" ] diff --git a/lib/providers/duniter_indexer.dart b/lib/providers/duniter_indexer.dart index 365b018..4c06b18 100644 --- a/lib/providers/duniter_indexer.dart +++ b/lib/providers/duniter_indexer.dart @@ -84,7 +84,8 @@ class DuniterIndexer with ChangeNotifier { return configBox.get('customIndexer'); } - if (configBox.containsKey('indexerEndpoint')) { + if (configBox.containsKey('indexerEndpoint') && + listIndexerEndpoints.contains(configBox.get('indexerEndpoint'))) { if (await checkIndexerEndpoint(configBox.get('indexerEndpoint'))) { return configBox.get('indexerEndpoint'); } @@ -98,7 +99,7 @@ class DuniterIndexer with ChangeNotifier { client.connectionTimeout = const Duration(milliseconds: 3000); do { - int listLenght = listIndexerEndpoints.length - 1; + final listLenght = listIndexerEndpoints.length - 1; if (i >= listLenght) { log.e('NO VALID INDEXER ENDPOINT FOUND'); indexerEndpoint = ''; @@ -111,7 +112,7 @@ class DuniterIndexer with ChangeNotifier { } try { - String endpointPath = '${listIndexerEndpoints[i]}/v1/graphql'; + final endpointPath = '${listIndexerEndpoints[i]}/v1/graphql'; final request = await client.postUrl(Uri.parse(endpointPath)); final response = await request.close();