fixed LTC wallet lookup
This commit is contained in:
parent
a8ff76de58
commit
05045cc37e
@ -109,13 +109,12 @@ public class MiningBean {
|
||||
try {
|
||||
if (ltcWallet != null && !"null".equals(ltcWallet) && ltcWallet.length() > 0) {
|
||||
restRequest = getStringResponse(
|
||||
"https://chain.so/api/v2/get_address_balance/LTC/".concat(ltcWallet));
|
||||
if (restRequest != null && restRequest.length() > 0) {
|
||||
JSONObject full = new JSONObject(restRequest);
|
||||
JSONObject data = (JSONObject) full.get("data");
|
||||
String confirmedBalance = (String) data.get("confirmed_balance");
|
||||
|
||||
double res = Double.parseDouble(confirmedBalance);
|
||||
"https://live.blockcypher.com/ltc/address/".concat(ltcWallet));
|
||||
if (restRequest != null && restRequest.length() > 0 && restRequest.contains("<span class=\"dash-label\">Balance</span>")) {
|
||||
int index = restRequest.indexOf("<span class=\"dash-label\">Balance</span>")+"<span class=\"dash-label\">Balance</span>".length();
|
||||
String text = restRequest.substring(index+4, index+15);
|
||||
|
||||
double res = Double.parseDouble(text);
|
||||
if (res > 0d) {
|
||||
resultStr = res + " LTC " + curSym + String.format("%.2f", (res * lastPrices[1]));
|
||||
} else
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user