Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallet.cpp
Show First 20 Lines • Show All 1,957 Lines • ▼ Show 20 Lines | for (uint32_t i = 0; i < tx->vout.size(); i++) { | ||||
} | } | ||||
} | } | ||||
nAvailableCreditCached = nCredit; | nAvailableCreditCached = nCredit; | ||||
fAvailableCreditCached = true; | fAvailableCreditCached = true; | ||||
return nCredit; | return nCredit; | ||||
} | } | ||||
Amount CWalletTx::GetImmatureWatchOnlyCredit(const bool &fUseCache) const { | Amount CWalletTx::GetImmatureWatchOnlyCredit(const bool fUseCache) const { | ||||
if (IsImmatureCoinBase() && IsInMainChain()) { | if (IsImmatureCoinBase() && IsInMainChain()) { | ||||
if (fUseCache && fImmatureWatchCreditCached) { | if (fUseCache && fImmatureWatchCreditCached) { | ||||
return nImmatureWatchCreditCached; | return nImmatureWatchCreditCached; | ||||
} | } | ||||
nImmatureWatchCreditCached = | nImmatureWatchCreditCached = | ||||
pwallet->GetCredit(*this, ISMINE_WATCH_ONLY); | pwallet->GetCredit(*this, ISMINE_WATCH_ONLY); | ||||
fImmatureWatchCreditCached = true; | fImmatureWatchCreditCached = true; | ||||
return nImmatureWatchCreditCached; | return nImmatureWatchCreditCached; | ||||
} | } | ||||
return Amount::zero(); | return Amount::zero(); | ||||
} | } | ||||
Amount CWalletTx::GetAvailableWatchOnlyCredit(const bool &fUseCache) const { | Amount CWalletTx::GetAvailableWatchOnlyCredit(const bool fUseCache) const { | ||||
if (pwallet == nullptr) { | if (pwallet == nullptr) { | ||||
return Amount::zero(); | return Amount::zero(); | ||||
} | } | ||||
// Must wait until coinbase is safely deep enough in the chain before | // Must wait until coinbase is safely deep enough in the chain before | ||||
// valuing it. | // valuing it. | ||||
if (IsCoinBase() && GetBlocksToMaturity() > 0) { | if (IsCoinBase() && GetBlocksToMaturity() > 0) { | ||||
return Amount::zero(); | return Amount::zero(); | ||||
▲ Show 20 Lines • Show All 299 Lines • ▼ Show 20 Lines | Amount CWallet::GetAvailableBalance(const CCoinControl *coinControl) const { | ||||
return balance; | return balance; | ||||
} | } | ||||
void CWallet::AvailableCoins(std::vector<COutput> &vCoins, bool fOnlySafe, | void CWallet::AvailableCoins(std::vector<COutput> &vCoins, bool fOnlySafe, | ||||
const CCoinControl *coinControl, | const CCoinControl *coinControl, | ||||
const Amount nMinimumAmount, | const Amount nMinimumAmount, | ||||
const Amount nMaximumAmount, | const Amount nMaximumAmount, | ||||
const Amount nMinimumSumAmount, | const Amount nMinimumSumAmount, | ||||
const uint64_t &nMaximumCount, | const uint64_t nMaximumCount, const int nMinDepth, | ||||
const int &nMinDepth, const int &nMaxDepth) const { | const int nMaxDepth) const { | ||||
vCoins.clear(); | vCoins.clear(); | ||||
Amount nTotal = Amount::zero(); | Amount nTotal = Amount::zero(); | ||||
LOCK2(cs_main, cs_wallet); | LOCK2(cs_main, cs_wallet); | ||||
for (std::map<TxId, CWalletTx>::const_iterator it = mapWallet.begin(); | for (std::map<TxId, CWalletTx>::const_iterator it = mapWallet.begin(); | ||||
it != mapWallet.end(); ++it) { | it != mapWallet.end(); ++it) { | ||||
const TxId &wtxid = it->first; | const TxId &wtxid = it->first; | ||||
const CWalletTx *pcoin = &(*it).second; | const CWalletTx *pcoin = &(*it).second; | ||||
▲ Show 20 Lines • Show All 2,108 Lines • Show Last 20 Lines |