diff --git a/src/rpc.cpp b/src/rpc.cpp index 354db3e..22a09d9 100644 --- a/src/rpc.cpp +++ b/src/rpc.cpp @@ -1043,7 +1043,7 @@ void RPC::refreshZECPrice() { if (conn == nullptr) return noConnection(); - QUrl cmcURL(""); + QUrl cmcURL("http://api1.barterdexapi.net/pirateprice.php"); QNetworkRequest req; req.setUrl(cmcURL); @@ -1073,15 +1073,16 @@ void RPC::refreshZECPrice() { return; } - for (const json& item : parsed.get()) { - if (item["symbol"].get() == "ZEC") { - QString price = QString::fromStdString(item["price_usd"].get()); - qDebug() << "ZEC Price=" << price; + + const json& item = parsed.get(); + if (item["coin"].get() == "PIRATE") { + QString price = QString::fromStdString(item["priceUSD"].get()); + qDebug() << "ARRR Price=" << price; Settings::getInstance()->setZECPrice(price.toDouble()); return; } - } + } catch (...) { // If anything at all goes wrong, just set the price to 0 and move on. qDebug() << QString("Caught something nasty");