aboutsummaryrefslogtreecommitdiff
path: root/src/qt/walletmodel.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2012-06-02 02:35:48 -0700
committerWladimir J. van der Laan <laanwj@gmail.com>2012-06-02 02:35:48 -0700
commit882ba0e7524b54be861b379366b5845a3978b256 (patch)
tree9a14251a5ef6b87e2fd63019b2287dbbad3e9528 /src/qt/walletmodel.cpp
parent88d7bc930a5834fe41f26af183e512bb34672dab (diff)
parent8fdb7e108fbe77010799c8de95453a327dfa5777 (diff)
downloadbitcoin-882ba0e7524b54be861b379366b5845a3978b256.tar.xz
Merge pull request #837 from sje397/ShowImmatureBalance
Added 'immature balance' for miners. Only displayed if the balance is > 0
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 033df98082..9245f774a4 100644
--- a/src/qt/walletmodel.cpp
+++ b/src/qt/walletmodel.cpp
@@ -14,7 +14,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);
@@ -38,6 +39,11 @@ qint64 WalletModel::getUnconfirmedBalance() const
return wallet->GetUnconfirmedBalance();
}
+qint64 WalletModel::getImmatureBalance() const
+{
+ return wallet->GetImmatureBalance();
+}
+
int WalletModel::getNumTransactions() const
{
int numTransactions = 0;
@@ -64,15 +70,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;
}