aboutsummaryrefslogtreecommitdiff
path: root/src/qt/walletmodel.h
diff options
context:
space:
mode:
authorsje397 <sje397@gmail.com>2012-02-14 22:08:00 +1100
committersje397 <sje397@gmail.com>2012-05-25 23:15:27 +1000
commit8fdb7e108fbe77010799c8de95453a327dfa5777 (patch)
tree4d325aee1953b9044a22926f52909b92658ada56 /src/qt/walletmodel.h
parent6b8a17119e30ddc5dd5b92ed77da49740c495ed6 (diff)
downloadbitcoin-8fdb7e108fbe77010799c8de95453a327dfa5777.tar.xz
Added 'immature balance' for miners. Only displayed if the balance is greater than zero.
This adds a field labelled 'Immature' in the overview section under the 'unconfirmed' field, which shows mined income that has not yet matured (which is currently not displayed anywhere, even though the transactions exist in the transaction list). To do that I added a 'GetImmatureBalance' method to the wallet, and connected that through to the GUI as per the 'GetBalance' and 'GetUnconfirmedBalance' methods. I did a small 'no-op' change to make the code in adjacent functions a little more readable (imo); it was a change I had made in my repo earlier...but I thought it wouldn't hurt so left it in. Immature balance comes from mined income that is at least two blocks deep in the chain (same logic as displayed transactions). My reasoning is: - as a miner, it's a critical stat I want to see - as a miner, and taking into account the label 'immature', the uncertainty is pretty clearly implied - those numbers are already displayed in the transaction list - this makes the overview numbers add up to what's in the transaction list - it's not displayed if the immature balance is 0, so won't bother non-miners I also 'cleaned' the overview UI a little, moving code to the XML and removing HTML.
Diffstat (limited to 'src/qt/walletmodel.h')
-rw-r--r--src/qt/walletmodel.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/qt/walletmodel.h b/src/qt/walletmodel.h
index 8b615ffe8e..c973c5cf53 100644
--- a/src/qt/walletmodel.h
+++ b/src/qt/walletmodel.h
@@ -52,6 +52,7 @@ public:
qint64 getBalance() const;
qint64 getUnconfirmedBalance() const;
+ qint64 getImmatureBalance() const;
int getNumTransactions() const;
EncryptionStatus getEncryptionStatus() const;
@@ -116,6 +117,7 @@ private:
// Cache some values to be able to detect changes
qint64 cachedBalance;
qint64 cachedUnconfirmedBalance;
+ qint64 cachedImmatureBalance;
qint64 cachedNumTransactions;
EncryptionStatus cachedEncryptionStatus;
@@ -123,7 +125,7 @@ private:
void unsubscribeFromCoreSignals();
signals:
// Signal that balance in wallet changed
- void balanceChanged(qint64 balance, qint64 unconfirmedBalance);
+ void balanceChanged(qint64 balance, qint64 unconfirmedBalance, qint64 immatureBalance);
// Number of transactions in wallet changed
void numTransactionsChanged(int count);