From c08ba24d328fb4b3e7de8d0b361cb1492823cfc3 Mon Sep 17 00:00:00 2001 From: Henry Varona Date: Wed, 19 Sep 2018 17:28:02 -0400 Subject: [PATCH] Fix Aplication url verification --- .../crystalwallet/application/CrystalApplication.java | 2 +- .../crystalwallet/network/BitsharesCryptoNetVerifier.java | 1 + .../agorise/crystalwallet/network/CryptoNetManager.java | 8 ++++++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/cy/agorise/crystalwallet/application/CrystalApplication.java b/app/src/main/java/cy/agorise/crystalwallet/application/CrystalApplication.java index 34fdc4f..9854491 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/application/CrystalApplication.java +++ b/app/src/main/java/cy/agorise/crystalwallet/application/CrystalApplication.java @@ -91,7 +91,7 @@ public class CrystalApplication extends Application { //Next line is for use the bitshares main net // TODO fix, the following line accepts one string not an array it needs to accept an arrey // TODO and hoop over the urls if no connection can be established - CryptoNetManager.addCryptoNetURL(CryptoNet.BITSHARES,BITSHARES_URL[2]); + CryptoNetManager.addCryptoNetURL(CryptoNet.BITSHARES,BITSHARES_URL); GeneralSetting generalSettingPreferredLanguage = db.generalSettingDao().getSettingByName(GeneralSetting.SETTING_NAME_PREFERRED_LANGUAGE); diff --git a/app/src/main/java/cy/agorise/crystalwallet/network/BitsharesCryptoNetVerifier.java b/app/src/main/java/cy/agorise/crystalwallet/network/BitsharesCryptoNetVerifier.java index 5f70961..1ec9e54 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/network/BitsharesCryptoNetVerifier.java +++ b/app/src/main/java/cy/agorise/crystalwallet/network/BitsharesCryptoNetVerifier.java @@ -33,6 +33,7 @@ public class BitsharesCryptoNetVerifier extends CryptoNetVerifier { @Override public void onError(BaseResponse.Error error) { //TODO handle error + System.out.println("Bad server response " + url); } }),url); thread.start(); diff --git a/app/src/main/java/cy/agorise/crystalwallet/network/CryptoNetManager.java b/app/src/main/java/cy/agorise/crystalwallet/network/CryptoNetManager.java index 5603df8..bbde434 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/network/CryptoNetManager.java +++ b/app/src/main/java/cy/agorise/crystalwallet/network/CryptoNetManager.java @@ -47,6 +47,14 @@ public abstract class CryptoNetManager { return 0; } + public static void addCryptoNetUrls(CryptoNet crypto, String[] urls){ + for(String url: urls){ + addCryptoNetURL(crypto,url); + } + } + + + public static void addCryptoNetURL(CryptoNet crypto, String url){ if(!CryptoNetURLs.containsKey(crypto)){ CryptoNetURLs.put(crypto,new HashSet());