diff --git a/src/rpc.cpp b/src/rpc.cpp index 151f06f..3d9fa8b 100644 --- a/src/rpc.cpp +++ b/src/rpc.cpp @@ -534,6 +534,7 @@ void RPC::refreshReceivedZTrans(QList zaddrs) { /// This will refresh all the balance data from hushd void RPC::refresh(bool force) { + qDebug() << __func__; if (conn == nullptr) return noConnection(); @@ -693,6 +694,8 @@ void RPC::getInfoThenRefresh(bool force) { price = QString(", ") % "HUSH" % "=" % QString::number( (double)ticker_price,'f',8) % " " % QString::fromStdString(ticker) % " " % extra; } + qDebug() << "Updating status bar"; + // Update the status bar QString statusText = QString() % (isSyncing ? QObject::tr("Syncing") : QObject::tr("Connected")) % @@ -708,8 +711,8 @@ void RPC::getInfoThenRefresh(bool force) { QString tooltip; if (connections > 0) { tooltip = QObject::tr("Connected to hushd"); - } - else { + } else { + qDeug() << "No connections!"; tooltip = QObject::tr("hushd has no peer connections! Network issues?"); } tooltip = tooltip % "(v" % QString::number(Settings::getInstance()->getZcashdVersion()) % ")"; @@ -719,9 +722,11 @@ void RPC::getInfoThenRefresh(bool force) { } main->statusLabel->setToolTip(tooltip); main->statusIcon->setToolTip(tooltip); + qDebug() << "Set tooltip"; }); }, [=](QNetworkReply* reply, const json&) { + qDebug() << "hushd is gone!"; // hushd has probably disappeared. this->noConnection(); @@ -739,6 +744,7 @@ void RPC::getInfoThenRefresh(bool force) { } void RPC::refreshAddresses() { + qDebug() << __func__; if (conn == nullptr) return noConnection(); @@ -804,6 +810,7 @@ bool RPC::processUnspent(const json& reply, QMap* balancesMap, }; void RPC::refreshBalances() { + qDebug() << "Updating balances"; if (conn == nullptr) return noConnection(); @@ -832,10 +839,12 @@ void RPC::refreshBalances() { auto newUtxos = new QList(); auto newBalances = new QMap(); + qDebug() << "Updating taddr balances"; // Call the Transparent and Z unspent APIs serially and then, once they're done, update the UI getTransparentUnspent([=] (json reply) { auto anyTUnconfirmed = processUnspent(reply, newBalances, newUtxos); + qDebug() << "Updating zaddr balances"; getZUnspent([=] (json reply) { auto anyZUnconfirmed = processUnspent(reply, newBalances, newUtxos); @@ -889,6 +898,7 @@ void RPC::refreshTransactions() { // Read sent Z transactions from the file. void RPC::refreshSentZTrans() { + qDebug() << __func__; if (conn == nullptr) return noConnection(); @@ -942,6 +952,7 @@ void RPC::refreshSentZTrans() { void RPC::addNewTxToWatch(const QString& newOpid, WatchedTx wtx) { watchingOps.insert(newOpid, wtx); + qDebug() << "Watched new opid " << opid; watchTxStatus(); } @@ -1274,8 +1285,8 @@ void RPC::shutdownZcashd() { */ QString RPC::getDefaultSaplingAddress() { for (QString addr: *zaddresses) { - if (Settings::getInstance()->isSaplingAddress(addr)) - return addr; + //if (Settings::getInstance()->isSaplingAddress(addr)) + return addr; } return QString(); diff --git a/src/rpc.h b/src/rpc.h index b599da5..71cd22f 100644 --- a/src/rpc.h +++ b/src/rpc.h @@ -1,3 +1,5 @@ +// Copyright 2019-2020 The Hush Developers +// Released under the GPLv3 #ifndef RPCCLIENT_H #define RPCCLIENT_H