Browse Source

Auto zero Camount

pull/14/head
Aditya Kulkarni 5 years ago
parent
commit
60bf9bfcb7
  1. 3
      src/controller.cpp
  2. 8
      src/sendtab.cpp
  3. 6
      src/txtablemodel.cpp
  4. 4
      src/websockets.cpp

3
src/controller.cpp

@ -290,7 +290,6 @@ void Controller::refreshBalances() {
ui->balTransparent->setText(balT.toDecimalZECString());
ui->balTotal ->setText(balTotal.toDecimalZECString());
auto price = Settings::getInstance()->getZECPrice();
ui->balSheilded ->setToolTip(balZ.toDecimalZECUSDString());
ui->balTransparent->setToolTip(balT.toDecimalZECUSDString());
ui->balTotal ->setToolTip(balTotal.toDecimalZECUSDString());
@ -330,7 +329,7 @@ void Controller::refreshTransactions() {
for (auto& it : reply.get<json::array_t>()) {
QString address;
CAmount total_amount = CAmount::fromqint64(0);
CAmount total_amount;
QList<TransactionItemDetail> items;
// First, check if there's outgoing metadata

8
src/sendtab.cpp

@ -176,7 +176,7 @@ void MainWindow::updateFromCombo() {
// delete
}
void MainWindow::inputComboTextChanged(int index) {
void MainWindow::inputComboTextChanged(int) {
// delete
}
@ -412,7 +412,7 @@ void MainWindow::maxAmountChecked(int checked) {
if (rpc == nullptr) return;
// Calculate maximum amount
CAmount sumAllAmounts = CAmount::fromqint64(0);
CAmount sumAllAmounts;
// Calculate all other amounts
int totalItems = ui->sendToWidgets->children().size() - 2; // The last one is a spacer, so ignore that
// Start counting the sum skipping the first one, because the MAX button is on the first one, and we don't
@ -445,7 +445,7 @@ Tx MainWindow::createTxFromSendPage() {
// For each addr/amt in the sendTo tab
int totalItems = ui->sendToWidgets->children().size() - 2; // The last one is a spacer, so ignore that
CAmount totalAmt = CAmount::fromqint64(0);
CAmount totalAmt;
for (int i=0; i < totalItems; i++) {
QString addr = ui->sendToWidgets->findChild<QLineEdit*>(QString("Address") % QString::number(i+1))->text().trimmed();
// Remove label if it exists
@ -538,7 +538,7 @@ bool MainWindow::confirmTx(Tx tx, RecurringPaymentInfo* rpi) {
// For each addr/amt/memo, construct the JSON and also build the confirm dialog box
int row = 0;
CAmount totalSpending = CAmount::fromqint64(0);
CAmount totalSpending;
for (int i=0; i < tx.toAddrs.size(); i++) {
auto toAddr = tx.toAddrs[i];

6
src/txtablemodel.cpp

@ -105,7 +105,7 @@ bool TxTableModel::exportToCsv(QString fileName) const {
case Column::Confirmations: return QString::number(dat.confirmations);
case Column::Amount: {
// Sum up all the amounts
CAmount total = CAmount::fromqint64(0);
CAmount total;
for (int i=0; i < dat.items.length(); i++) {
total = total + dat.items[i].amount;
}
@ -141,7 +141,7 @@ bool TxTableModel::exportToCsv(QString fileName) const {
case Column::Confirmations: return QString("%1 Network Confirmations").arg(QString::number(dat.confirmations));
case Column::Amount: {
// Sum up all the amounts
CAmount total = CAmount::fromqint64(0);
CAmount total;
for (int i=0; i < dat.items.length(); i++) {
total = total + dat.items[i].amount;
}
@ -237,7 +237,7 @@ QString TxTableModel::getType(int row) const {
QString TxTableModel::getAmt(int row) const {
auto dat = modeldata->at(row);
CAmount total = CAmount::fromqint64(0);
CAmount total;
for (int i=0; i < dat.items.length(); i++) {
total = total + dat.items[i].amount;
}

4
src/websockets.cpp

@ -736,8 +736,8 @@ void AppDataServer::processGetInfo(QJsonObject jobj, MainWindow* mainWindow, std
}
// Max spendable safely from a z address and from any address
CAmount maxZSpendable = CAmount::fromqint64(0);
CAmount maxSpendable = CAmount::fromqint64(0);
CAmount maxZSpendable;
CAmount maxSpendable;
for (auto a : mainWindow->getRPC()->getModel()->getAllBalances().keys()) {
if (Settings::getInstance()->isSaplingAddress(a)) {
if (mainWindow->getRPC()->getModel()->getAllBalances().value(a) > maxZSpendable) {

Loading…
Cancel
Save