Fix Aplication url verification

This commit is contained in:
Henry Varona 2018-09-19 17:28:02 -04:00
parent 272843843c
commit c08ba24d32
3 changed files with 10 additions and 1 deletions

View file

@ -91,7 +91,7 @@ public class CrystalApplication extends Application {
//Next line is for use the bitshares main net //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 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 // 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); GeneralSetting generalSettingPreferredLanguage = db.generalSettingDao().getSettingByName(GeneralSetting.SETTING_NAME_PREFERRED_LANGUAGE);

View file

@ -33,6 +33,7 @@ public class BitsharesCryptoNetVerifier extends CryptoNetVerifier {
@Override @Override
public void onError(BaseResponse.Error error) { public void onError(BaseResponse.Error error) {
//TODO handle error //TODO handle error
System.out.println("Bad server response " + url);
} }
}),url); }),url);
thread.start(); thread.start();

View file

@ -47,6 +47,14 @@ public abstract class CryptoNetManager {
return 0; 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){ public static void addCryptoNetURL(CryptoNet crypto, String url){
if(!CryptoNetURLs.containsKey(crypto)){ if(!CryptoNetURLs.containsKey(crypto)){
CryptoNetURLs.put(crypto,new HashSet<String>()); CryptoNetURLs.put(crypto,new HashSet<String>());