aboutsummaryrefslogtreecommitdiff
path: root/src/qt/walletmodel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qt/walletmodel.cpp')
-rw-r--r--src/qt/walletmodel.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp
index b89c3dba33..807dfc6bf8 100644
--- a/src/qt/walletmodel.cpp
+++ b/src/qt/walletmodel.cpp
@@ -13,7 +13,8 @@
WalletModel::WalletModel(CWallet *wallet, OptionsModel *optionsModel, QObject *parent) :
QObject(parent), wallet(wallet), optionsModel(optionsModel), addressTableModel(0),
transactionTableModel(0),
- cachedBalance(0), cachedUnconfirmedBalance(0), cachedNumTransactions(0),
+ cachedBalance(0), cachedUnconfirmedBalance(0), cachedImmatureBalance(0),
+ cachedNumTransactions(0),
cachedEncryptionStatus(Unencrypted)
{
addressTableModel = new AddressTableModel(wallet, this);
@@ -37,6 +38,11 @@ qint64 WalletModel::getUnconfirmedBalance() const
return wallet->GetUnconfirmedBalance();
}
+qint64 WalletModel::getImmatureBalance() const
+{
+ return wallet->GetImmatureBalance();
+}
+
int WalletModel::getNumTransactions() const
{
int numTransactions = 0;
@@ -63,15 +69,18 @@ void WalletModel::updateTransaction(const QString &hash, int status)
// Balance and number of transactions might have changed
qint64 newBalance = getBalance();
qint64 newUnconfirmedBalance = getUnconfirmedBalance();
+ qint64 newImmatureBalance = getImmatureBalance();
int newNumTransactions = getNumTransactions();
- if(cachedBalance != newBalance || cachedUnconfirmedBalance != newUnconfirmedBalance)
- emit balanceChanged(newBalance, newUnconfirmedBalance);
+ if(cachedBalance != newBalance || cachedUnconfirmedBalance != newUnconfirmedBalance || cachedImmatureBalance != newImmatureBalance)
+ emit balanceChanged(newBalance, newUnconfirmedBalance, newImmatureBalance);
+
if(cachedNumTransactions != newNumTransactions)
emit numTransactionsChanged(newNumTransactions);
cachedBalance = newBalance;
cachedUnconfirmedBalance = newUnconfirmedBalance;
+ cachedImmatureBalance = newImmatureBalance;
cachedNumTransactions = newNumTransactions;
}