diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -286,7 +286,7 @@ mutable bool fChangeCached; mutable Amount nDebitCached; mutable Amount nCreditCached; - mutable CAmount nImmatureCreditCached; + mutable Amount nImmatureCreditCached; mutable CAmount nAvailableCreditCached; mutable CAmount nWatchDebitCached; mutable CAmount nWatchCreditCached; @@ -395,7 +395,7 @@ //! filter decides which addresses will count towards the debit Amount GetDebit(const isminefilter &filter) const; Amount GetCredit(const isminefilter &filter) const; - CAmount GetImmatureCredit(bool fUseCache = true) const; + Amount GetImmatureCredit(bool fUseCache = true) const; CAmount GetAvailableCredit(bool fUseCache = true) const; CAmount GetImmatureWatchOnlyCredit(const bool &fUseCache = true) const; CAmount GetAvailableWatchOnlyCredit(const bool &fUseCache = true) const; diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -1902,7 +1902,7 @@ return credit; } -CAmount CWalletTx::GetImmatureCredit(bool fUseCache) const { +Amount CWalletTx::GetImmatureCredit(bool fUseCache) const { if (IsCoinBase() && GetBlocksToMaturity() > 0 && IsInMainChain()) { if (fUseCache && fImmatureCreditCached) return nImmatureCreditCached; nImmatureCreditCached = @@ -2170,14 +2170,14 @@ CAmount CWallet::GetImmatureBalance() const { LOCK2(cs_main, cs_wallet); - CAmount nTotal = 0; + Amount nTotal = 0; for (std::map::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it) { const CWalletTx *pcoin = &(*it).second; nTotal += pcoin->GetImmatureCredit(); } - return nTotal; + return nTotal.GetSatoshis(); } CAmount CWallet::GetWatchOnlyBalance() const {