diff --git a/src/mainwindow.h b/src/mainwindow.h index 692a332..1b1eea0 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -42,7 +42,6 @@ public: QString doSendTxValidations(Tx tx); void setDefaultPayFrom(); - RPC* getRPC() { return rpc; } Ui::MainWindow* ui; diff --git a/src/rpc.cpp b/src/rpc.cpp index 27c7c15..3dd7bf5 100644 --- a/src/rpc.cpp +++ b/src/rpc.cpp @@ -1022,13 +1022,7 @@ void RPC::checkForUpdate(bool silent) { QObject::tr("You already have the latest release v%1") .arg(currentVersion.toString())); } - } else { - if (!silent) { - QMessageBox::information(main, QObject::tr("No updates available"), - QObject::tr("You already have the latest release v%1") - .arg(currentVersion.toString())); - } - } + } } } catch (...) { diff --git a/src/rpc.h b/src/rpc.h index 689ecbe..720f286 100644 --- a/src/rpc.h +++ b/src/rpc.h @@ -58,7 +58,7 @@ public: void sendZTransaction(json params, const std::function& cb, const std::function& err); void watchTxStatus(); - const QMap getWatchingTxns() { return watchingOps; } + const QMap getWatchingTxns() { return watchingOps; } void addNewTxToWatch(const QString& newOpid, WatchedTx wtx); const TxTableModel* getTransactionsModel() { return transactionsTableModel; } diff --git a/src/websockets.cpp b/src/websockets.cpp index ae487c4..a74e7da 100644 --- a/src/websockets.cpp +++ b/src/websockets.cpp @@ -442,14 +442,17 @@ void AppDataServer::processSendTx(QJsonObject sendTx, MainWindow* mainwindow, QW std::cout << std::setw(2) << params << std::endl; // And send the Tx - mainwindow->getRPC()->sendZTransaction(params, [=](const json& reply) { - QString opid = QString::fromStdString(reply.get()); + mainwindow->getRPC()->executeTransaction(tx, + [=] (QString opid) { - // And then start monitoring the transaction - mainwindow->getRPC()->addNewTxToWatch(tx, opid); + }, + [=] (QString opid, QString txid) { - // TODO: Handle the error if the computed Tx fails. - }); + }, + [=] (QString opid, QString errStr) { + + } + ); auto r = QJsonDocument(QJsonObject{ {"version", 1.0}, @@ -498,10 +501,10 @@ void AppDataServer::processGetTransactions(MainWindow* mainWindow, QWebSocket* p txns.append(QJsonObject{ {"type", "send"}, {"datetime", QDateTime::currentSecsSinceEpoch()}, - {"amount", Settings::getDecimalString(wtxns[opid].toAddrs[0].amount)}, + {"amount", Settings::getDecimalString(wtxns[opid].tx.toAddrs[0].amount)}, {"txid", ""}, - {"address", wtxns[opid].toAddrs[0].addr}, - {"memo", wtxns[opid].toAddrs[0].txtMemo}, + {"address", wtxns[opid].tx.toAddrs[0].addr}, + {"memo", wtxns[opid].tx.toAddrs[0].txtMemo}, {"confirmations", 0} }); }