Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallet.cpp
Show First 20 Lines • Show All 1,896 Lines • ▼ Show 20 Lines | if (filter & ISMINE_WATCH_ONLY) { | ||||
fWatchCreditCached = true; | fWatchCreditCached = true; | ||||
credit += nWatchCreditCached; | credit += nWatchCreditCached; | ||||
} | } | ||||
} | } | ||||
return credit; | return credit; | ||||
} | } | ||||
CAmount CWalletTx::GetImmatureCredit(bool fUseCache) const { | Amount CWalletTx::GetImmatureCredit(bool fUseCache) const { | ||||
if (IsCoinBase() && GetBlocksToMaturity() > 0 && IsInMainChain()) { | if (IsCoinBase() && GetBlocksToMaturity() > 0 && IsInMainChain()) { | ||||
if (fUseCache && fImmatureCreditCached) return nImmatureCreditCached; | if (fUseCache && fImmatureCreditCached) return nImmatureCreditCached; | ||||
nImmatureCreditCached = | nImmatureCreditCached = | ||||
pwallet->GetCredit(*this, ISMINE_SPENDABLE).GetSatoshis(); | pwallet->GetCredit(*this, ISMINE_SPENDABLE).GetSatoshis(); | ||||
fImmatureCreditCached = true; | fImmatureCreditCached = true; | ||||
return nImmatureCreditCached; | return nImmatureCreditCached; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 251 Lines • ▼ Show 20 Lines | CAmount CWallet::GetUnconfirmedBalance() const { | ||||
} | } | ||||
return nTotal; | return nTotal; | ||||
} | } | ||||
CAmount CWallet::GetImmatureBalance() const { | CAmount CWallet::GetImmatureBalance() const { | ||||
LOCK2(cs_main, cs_wallet); | LOCK2(cs_main, cs_wallet); | ||||
CAmount nTotal = 0; | Amount nTotal = 0; | ||||
for (std::map<uint256, CWalletTx>::const_iterator it = mapWallet.begin(); | for (std::map<uint256, CWalletTx>::const_iterator it = mapWallet.begin(); | ||||
it != mapWallet.end(); ++it) { | it != mapWallet.end(); ++it) { | ||||
const CWalletTx *pcoin = &(*it).second; | const CWalletTx *pcoin = &(*it).second; | ||||
nTotal += pcoin->GetImmatureCredit(); | nTotal += pcoin->GetImmatureCredit(); | ||||
} | } | ||||
return nTotal; | return nTotal.GetSatoshis(); | ||||
} | } | ||||
CAmount CWallet::GetWatchOnlyBalance() const { | CAmount CWallet::GetWatchOnlyBalance() const { | ||||
LOCK2(cs_main, cs_wallet); | LOCK2(cs_main, cs_wallet); | ||||
CAmount nTotal = 0; | CAmount nTotal = 0; | ||||
for (std::map<uint256, CWalletTx>::const_iterator it = mapWallet.begin(); | for (std::map<uint256, CWalletTx>::const_iterator it = mapWallet.begin(); | ||||
it != mapWallet.end(); ++it) { | it != mapWallet.end(); ++it) { | ||||
▲ Show 20 Lines • Show All 2,306 Lines • Show Last 20 Lines |