Browse Source

Mo debug, less dead code

old_duke
Duke Leto 4 years ago
parent
commit
da18296712
  1. 2
      src/connection.cpp
  2. 20
      src/rpc.cpp
  3. 3
      src/rpc.h

2
src/connection.cpp

@ -449,7 +449,6 @@ void ConnectionLoader::doManualConnect() {
}
void ConnectionLoader::doRPCSetConnection(Connection* conn) {
rpc->setEZcashd(ezcashd);
rpc->setConnection(conn);
d->accept();
@ -547,7 +546,6 @@ void ConnectionLoader::showInformation(QString info, QString detail) {
* Show error will close the loading dialog and show an error.
*/
void ConnectionLoader::showError(QString explanation) {
rpc->setEZcashd(nullptr);
rpc->noConnection();
QMessageBox::critical(main, QObject::tr("Connection Error"), explanation, QMessageBox::Ok);

20
src/rpc.cpp

@ -48,7 +48,7 @@ RPC::RPC(MainWindow* main) {
qDebug() << "Watching tx status";
watchTxStatus();
});
// Start at every 10s. When an operation is pending, this will change to every second
// Start at normal updateSpeed. When an operation is pending, this will change to quickUpdateSpeed
txTimer->start(Settings::updateSpeed);
usedAddresses = new QMap<QString, bool>();
@ -57,27 +57,16 @@ RPC::RPC(MainWindow* main) {
RPC::~RPC() {
delete timer;
delete txTimer;
delete transactionsTableModel;
delete balancesTableModel;
delete utxos;
delete allBalances;
delete usedAddresses;
delete zaddresses;
delete taddresses;
delete conn;
}
void RPC::setEZcashd(std::shared_ptr<QProcess> p) {
ezcashd = p;
if (ezcashd && ui->tabWidget->widget(4) == nullptr) {
ui->tabWidget->addTab(main->zcashdtab, "zcashd");
}
}
// Called when a connection to hushd is available.
void RPC::setConnection(Connection* c) {
if (c == nullptr) return;
@ -893,6 +882,7 @@ void RPC::refreshTransactions() {
// Read sent Z transactions from the file.
void RPC::refreshSentZTrans() {
qDebug() << "refreshing sent ztx's";
if (conn == nullptr)
return noConnection();
@ -946,6 +936,7 @@ void RPC::refreshSentZTrans() {
void RPC::addNewTxToWatch(const QString& newOpid, WatchedTx wtx) {
watchingOps.insert(newOpid, wtx);
qDebug() << newOpid << " added to watchlist";
watchTxStatus();
}
@ -965,6 +956,7 @@ void RPC::executeTransaction(Tx tx,
QString opid = reply.toString();
// And then start monitoring the transaction
qDebug() << "Starting to watch " << opid;
addNewTxToWatch( opid, WatchedTx { opid, tx, computed, error} );
submitted(opid);
},
@ -1016,10 +1008,10 @@ void RPC::watchTxStatus() {
}
if (watchingOps.isEmpty()) {
qDebug() << "Using default update speed";
qDebug() << "Using default update speed " << Settings::updateSpeed;
txTimer->start(Settings::updateSpeed);
} else {
qDebug() << "Using quick update speed";
qDebug() << "Using quick update speed " << Settings::quickUpdateSpeed;
txTimer->start(Settings::quickUpdateSpeed);
}
}

3
src/rpc.h

@ -1,3 +1,5 @@
// Copyright 20190-2020 The Hush developers
// Released under the GPLv3
#ifndef RPCCLIENT_H
#define RPCCLIENT_H
@ -36,7 +38,6 @@ public:
~RPC();
void setConnection(Connection* c);
void setEZcashd(std::shared_ptr<QProcess> p);
const QProcess* getEZcashD() { return ezcashd.get(); }
void refresh(bool force = false);

Loading…
Cancel
Save