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