diff --git a/src/mainwindow.ui b/src/mainwindow.ui index 9e408c4..b676ac3 100644 --- a/src/mainwindow.ui +++ b/src/mainwindow.ui @@ -22,7 +22,7 @@ - 0 + 1 @@ -362,6 +362,9 @@ 0 + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + Amount diff --git a/src/turnstile.cpp b/src/turnstile.cpp index d7d810e..53c8b21 100644 --- a/src/turnstile.cpp +++ b/src/turnstile.cpp @@ -155,21 +155,15 @@ QList Turnstile::splitAmount(double amount, int parts) { // Add the Tx fees sumofparts += amounts.size() * Utils::getMinerFee(); + qDebug() << QString::number(sumofparts, 'f', 8) << QString::number(amount, 'f', 8); Q_ASSERT(QString::number(sumofparts, 'f', 8) == QString::number(amount, 'f', 8)); return amounts; } void Turnstile::fillAmounts(QList& amounts, double amount, int count) { if (count == 1 || amount < 0.01) { - // Split the chaff. - // Chaff is all amounts lesser than 0.0001 ZEC. The chaff will be added to the - // dev fee, and is done so to protect privacy. - - // Get the rounded value to 4 decimal places (approx $0.01) - double actual = std::floor(amount * 10000) / 10000; - // Also account for the fees needed to send all these transactions - actual = actual - (Utils::getMinerFee() * (amounts.size() + 1)); + auto actual = amount - (Utils::getMinerFee() * (amounts.size() + 1)); amounts.push_back(actual); return; @@ -317,6 +311,11 @@ void Turnstile::executeMigrationStep() { return; } + if (!rpc->getAllBalances()->keys().contains(nextStep->intTAddr)) { + qDebug() << QString("The int address doesn't have balance, even though it is confirmed"); + return; + } + // Send it to the final destination address. auto bal = rpc->getAllBalances()->value(nextStep->intTAddr); auto sendAmt = bal - Utils::getMinerFee(); diff --git a/src/ui_mainwindow.h b/src/ui_mainwindow.h index ac1195a..66e0e13 100644 --- a/src/ui_mainwindow.h +++ b/src/ui_mainwindow.h @@ -409,6 +409,7 @@ public: Amount1 = new QLineEdit(verticalGroupBox); Amount1->setObjectName(QStringLiteral("Amount1")); Amount1->setBaseSize(QSize(200, 0)); + Amount1->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); horizontalLayout_13->addWidget(Amount1); @@ -683,7 +684,7 @@ public: retranslateUi(MainWindow); - tabWidget->setCurrentIndex(0); + tabWidget->setCurrentIndex(1); QMetaObject::connectSlotsByName(MainWindow);