From bde2b0cb1e72352402108ba9f97f906292281cfe Mon Sep 17 00:00:00 2001 From: poka Date: Tue, 28 Nov 2023 22:23:56 +0100 Subject: [PATCH] enh: remove p2p.legal indexer endpoint --- config/indexer_endpoints.json | 1 - lib/providers/duniter_indexer.dart | 7 ++++--- 2 files changed, 4 insertions(+), 4 deletions(-) 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();