Merge master

This commit is contained in:
Aditya Kulkarni
2019-02-01 11:15:42 -08:00
parent 7c71457cc1
commit 45c3cee410
4 changed files with 14 additions and 18 deletions

View File

@@ -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<json::string_t>());
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}
});
}