From b0ff11d635aebf8828359dc6dce1e7d257dd76c6 Mon Sep 17 00:00:00 2001 From: Cryptoforge Date: Wed, 2 Dec 2020 13:24:12 -0800 Subject: [PATCH] minor fixes balances tab --- src/mainwindow.cpp | 2 +- src/rpc.cpp | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index ef333183..610b5115 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -1320,7 +1320,7 @@ void MainWindow::setupBalancesTab() { } // And switch to the send tab. - ui->tabWidget->setCurrentIndex(1); + ui->tabWidget->setCurrentIndex(2); }; // Double click opens up memo if one exists diff --git a/src/rpc.cpp b/src/rpc.cpp index 992767e8..eea00ad5 100644 --- a/src/rpc.cpp +++ b/src/rpc.cpp @@ -1127,11 +1127,11 @@ void RPC::refreshGetAllData() { newAddressBalance.immature = QString::number(it.value()["immature"].get(),'f', 8); newAddressBalance.locked = QString::number(it.value()["locked"].get(),'f', 8); newAddressBalance.watch = QString::number(it.value()["spendable"].get()); - long totalBalance = newAddressBalance.confirmed.toDouble() * 1e08; - totalBalance += newAddressBalance.unconfirmed.toDouble() * 1e08; - totalBalance += newAddressBalance.immature.toDouble() * 1e08; - totalBalance += newAddressBalance.locked.toDouble() * 1e08; - if (totalBalance > 0) { + double totalBalance = it.value()["amount"].get(); + totalBalance += it.value()["unconfirmed"].get(); + totalBalance += it.value()["immature"].get(); + totalBalance += it.value()["locked"].get(); + if (totalBalance > 0.0) { newAddressBalances->append(newAddressBalance); } }