diff --git a/lib/g1/api.dart b/lib/g1/api.dart index 6f71c2206e81dbf37a06682ba597808f94055d45..c980c3485ff5e9cefe7de82ffe95af451a0b723c 100644 --- a/lib/g1/api.dart +++ b/lib/g1/api.dart @@ -55,8 +55,10 @@ Not found sample: } */ Future<Contact> getWot(Contact contact) async { - final Response response = - await requestCPlusWithRetry('/wot/lookup/${contact.pubkey}'); + final Response response = await requestDuniterWithRetry( + '/wot/lookup/${contact.pubkey}', + retryWith404: false); + // Will be better to analyze the 404 response (to detect faulty node) if (response.statusCode == HttpStatus.ok) { final Map<String, dynamic> data = json.decode(response.body) as Map<String, dynamic>; @@ -291,6 +293,11 @@ Future<http.Response> requestWithRetry(NodeType type, String path, return _requestWithRetry(type, path, dontRecord, retryWith404); } +Future<http.Response> requestDuniterWithRetry(String path, + {bool retryWith404 = true}) async { + return _requestWithRetry(NodeType.duniter, path, true, retryWith404); +} + Future<http.Response> requestCPlusWithRetry(String path, {bool retryWith404 = true}) async { return _requestWithRetry(NodeType.cesiumPlus, path, true, retryWith404);