Remove debug warnings from screen
This commit is contained in:
@@ -8,7 +8,7 @@
|
|||||||
#include "balancestablemodel.h"
|
#include "balancestablemodel.h"
|
||||||
#include "settings.h"
|
#include "settings.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#import "turnstile.h"
|
#include "turnstile.h"
|
||||||
#include "senttxstore.h"
|
#include "senttxstore.h"
|
||||||
|
|
||||||
#include "precompiled.h"
|
#include "precompiled.h"
|
||||||
@@ -198,9 +198,9 @@ void MainWindow::turnstileDoMigration() {
|
|||||||
// Privacy level combobox
|
// Privacy level combobox
|
||||||
// Num tx over num blocks
|
// Num tx over num blocks
|
||||||
QList<QPair<int, int>> privOptions;
|
QList<QPair<int, int>> privOptions;
|
||||||
privOptions.push_back(QPair<double, double>(3, 3));
|
privOptions.push_back(QPair<double, double>(3, 6));
|
||||||
privOptions.push_back(QPair<double, double>(5, 5));
|
privOptions.push_back(QPair<double, double>(5, 10));
|
||||||
privOptions.push_back(QPair<double, double>(10, 7));
|
privOptions.push_back(QPair<double, double>(10, 20));
|
||||||
|
|
||||||
QObject::connect(turnstile.privLevel, QOverload<int>::of(&QComboBox::currentIndexChanged), [=] (auto idx) {
|
QObject::connect(turnstile.privLevel, QOverload<int>::of(&QComboBox::currentIndexChanged), [=] (auto idx) {
|
||||||
// Update the fees
|
// Update the fees
|
||||||
@@ -208,9 +208,9 @@ void MainWindow::turnstileDoMigration() {
|
|||||||
Settings::getInstance()->getZECUSDDisplayFormat(privOptions[idx].first * Utils::getMinerFee()));
|
Settings::getInstance()->getZECUSDDisplayFormat(privOptions[idx].first * Utils::getMinerFee()));
|
||||||
});
|
});
|
||||||
|
|
||||||
turnstile.privLevel->addItem("Good - 3 tx over 3 blocks");
|
turnstile.privLevel->addItem("Good - 3 tx over 6 blocks");
|
||||||
turnstile.privLevel->addItem("Excellent - 5 tx over 5 blocks");
|
turnstile.privLevel->addItem("Excellent - 5 tx over 10 blocks");
|
||||||
turnstile.privLevel->addItem("Paranoid - 10 tx over 7 blocks");
|
turnstile.privLevel->addItem("Paranoid - 10 tx over 20 blocks");
|
||||||
|
|
||||||
turnstile.buttonBox->button(QDialogButtonBox::Ok)->setText("Start");
|
turnstile.buttonBox->button(QDialogButtonBox::Ok)->setText("Start");
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
using json = nlohmann::json;
|
using json = nlohmann::json;
|
||||||
|
|
||||||
Turnstile::Turnstile(RPC* _rpc, QWidget* mainwindow) {
|
Turnstile::Turnstile(RPC* _rpc, MainWindow* mainwindow) {
|
||||||
this->rpc = _rpc;
|
this->rpc = _rpc;
|
||||||
this->mainwindow = mainwindow;
|
this->mainwindow = mainwindow;
|
||||||
}
|
}
|
||||||
@@ -19,8 +19,8 @@ Turnstile::~Turnstile() {
|
|||||||
|
|
||||||
void printPlan(QList<TurnstileMigrationItem> plan) {
|
void printPlan(QList<TurnstileMigrationItem> plan) {
|
||||||
for (auto item : plan) {
|
for (auto item : plan) {
|
||||||
qDebug() << item.fromAddr << item.intTAddr
|
//qDebug() << item.fromAddr << item.intTAddr
|
||||||
<< item.destAddr << item.amount << item.blockNumber << item.status;
|
// << item.destAddr << item.amount << item.blockNumber << item.status;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -55,7 +55,7 @@ QDataStream &operator>>(QDataStream& ds, TurnstileMigrationItem& item) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Turnstile::writeMigrationPlan(QList<TurnstileMigrationItem> plan) {
|
void Turnstile::writeMigrationPlan(QList<TurnstileMigrationItem> plan) {
|
||||||
qDebug() << QString("Writing plan");
|
//qDebug() << QString("Writing plan");
|
||||||
printPlan(plan);
|
printPlan(plan);
|
||||||
|
|
||||||
QFile file(writeableFile());
|
QFile file(writeableFile());
|
||||||
@@ -159,7 +159,7 @@ QList<double> Turnstile::splitAmount(double amount, int parts) {
|
|||||||
return amounts;
|
return amounts;
|
||||||
|
|
||||||
fillAmounts(amounts, amount, parts);
|
fillAmounts(amounts, amount, parts);
|
||||||
qDebug() << amounts;
|
//qDebug() << amounts;
|
||||||
|
|
||||||
// Ensure they all add up!
|
// Ensure they all add up!
|
||||||
double sumofparts = 0;
|
double sumofparts = 0;
|
||||||
@@ -170,8 +170,8 @@ QList<double> Turnstile::splitAmount(double amount, int parts) {
|
|||||||
// Add the Tx fees
|
// Add the Tx fees
|
||||||
sumofparts += amounts.size() * Utils::getMinerFee();
|
sumofparts += amounts.size() * Utils::getMinerFee();
|
||||||
|
|
||||||
qDebug() << QString::number(sumofparts, 'f', 8) << QString::number(amount, 'f', 8);
|
//qDebug() << QString::number(sumofparts, 'f', 8) << QString::number(amount, 'f', 8);
|
||||||
Q_ASSERT(QString::number(sumofparts, 'f', 8) == QString::number(amount, 'f', 8));
|
//Q_ASSERT(QString::number(sumofparts, 'f', 8) == QString::number(amount, 'f', 8));
|
||||||
return amounts;
|
return amounts;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -249,7 +249,7 @@ ProgressReport Turnstile::getPlanProgress() {
|
|||||||
void Turnstile::executeMigrationStep() {
|
void Turnstile::executeMigrationStep() {
|
||||||
auto plan = readMigrationPlan();
|
auto plan = readMigrationPlan();
|
||||||
|
|
||||||
qDebug() << QString("Executing step");
|
//qDebug() << QString("Executing step");
|
||||||
printPlan(plan);
|
printPlan(plan);
|
||||||
|
|
||||||
// Get to the next unexecuted step
|
// Get to the next unexecuted step
|
||||||
@@ -282,7 +282,7 @@ void Turnstile::executeMigrationStep() {
|
|||||||
if (nextStep->status == TurnstileMigrationItemStatus::NotStarted) {
|
if (nextStep->status == TurnstileMigrationItemStatus::NotStarted) {
|
||||||
// Does this z addr have enough balance?
|
// Does this z addr have enough balance?
|
||||||
if (fnHasUnconfirmed(nextStep->fromAddr)) {
|
if (fnHasUnconfirmed(nextStep->fromAddr)) {
|
||||||
qDebug() << QString("unconfirmed, waiting");
|
//qDebug() << QString("unconfirmed, waiting");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -318,12 +318,12 @@ void Turnstile::executeMigrationStep() {
|
|||||||
// First thing to do is check to see if the funds are confirmed.
|
// First thing to do is check to see if the funds are confirmed.
|
||||||
// We'll check both the original sprout address and the intermediate T addr for safety.
|
// We'll check both the original sprout address and the intermediate T addr for safety.
|
||||||
if (fnHasUnconfirmed(nextStep->intTAddr) || fnHasUnconfirmed(nextStep->fromAddr)) {
|
if (fnHasUnconfirmed(nextStep->intTAddr) || fnHasUnconfirmed(nextStep->fromAddr)) {
|
||||||
qDebug() << QString("unconfirmed, waiting");
|
//qDebug() << QString("unconfirmed, waiting");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!rpc->getAllBalances()->keys().contains(nextStep->intTAddr)) {
|
if (!rpc->getAllBalances()->keys().contains(nextStep->intTAddr)) {
|
||||||
qDebug() << QString("The int address doesn't have balance, even though it is confirmed");
|
qDebug() << QString("The intermediate Taddress doesn't have balance, even though it is confirmed");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -358,8 +358,8 @@ void Turnstile::doSendTx(Tx tx, std::function<void(void)> cb) {
|
|||||||
std::cout << std::setw(2) << params << std::endl;
|
std::cout << std::setw(2) << params << std::endl;
|
||||||
rpc->sendZTransaction(params, [=] (const json& reply) {
|
rpc->sendZTransaction(params, [=] (const json& reply) {
|
||||||
QString opid = QString::fromStdString(reply.get<json::string_t>());
|
QString opid = QString::fromStdString(reply.get<json::string_t>());
|
||||||
qDebug() << opid;
|
//qDebug() << opid;
|
||||||
//ui->statusBar->showMessage("Computing Tx: " % opid);
|
mainwindow->ui->statusBar->showMessage("Computing Tx: " % opid);
|
||||||
|
|
||||||
// And then start monitoring the transaction
|
// And then start monitoring the transaction
|
||||||
rpc->addNewTxToWatch(tx, opid);
|
rpc->addNewTxToWatch(tx, opid);
|
||||||
|
|||||||
@@ -4,8 +4,10 @@
|
|||||||
#include "precompiled.h"
|
#include "precompiled.h"
|
||||||
|
|
||||||
class RPC;
|
class RPC;
|
||||||
|
class MainWindow;
|
||||||
struct Tx;
|
struct Tx;
|
||||||
|
|
||||||
|
|
||||||
struct TurnstileMigrationItem {
|
struct TurnstileMigrationItem {
|
||||||
QString fromAddr;
|
QString fromAddr;
|
||||||
QString intTAddr;
|
QString intTAddr;
|
||||||
@@ -33,7 +35,7 @@ struct ProgressReport {
|
|||||||
class Turnstile
|
class Turnstile
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Turnstile(RPC* _rpc, QWidget* mainwindow);
|
Turnstile(RPC* _rpc, MainWindow* mainwindow);
|
||||||
~Turnstile();
|
~Turnstile();
|
||||||
|
|
||||||
void planMigration(QString zaddr, QString destAddr, int splits, int numBlocks);
|
void planMigration(QString zaddr, QString destAddr, int splits, int numBlocks);
|
||||||
@@ -59,7 +61,7 @@ private:
|
|||||||
QList<TurnstileMigrationItem>::Iterator getNextStep(QList<TurnstileMigrationItem>& plan);
|
QList<TurnstileMigrationItem>::Iterator getNextStep(QList<TurnstileMigrationItem>& plan);
|
||||||
|
|
||||||
RPC* rpc;
|
RPC* rpc;
|
||||||
QWidget* mainwindow;
|
MainWindow* mainwindow;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user