mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-05-22 18:05:19 +02:00
wallet: remove always true 'fUseCache' arg from CachedTxGetAvailableCredit
This commit is contained in:
parent
4f0ca9bff6
commit
04c6423f7b
@ -186,7 +186,7 @@ CAmount CachedTxGetImmatureWatchOnlyCredit(const CWallet& wallet, const CWalletT
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
CAmount CachedTxGetAvailableCredit(const CWallet& wallet, const CWalletTx& wtx, bool fUseCache, const isminefilter& filter)
|
CAmount CachedTxGetAvailableCredit(const CWallet& wallet, const CWalletTx& wtx, const isminefilter& filter)
|
||||||
{
|
{
|
||||||
AssertLockHeld(wallet.cs_wallet);
|
AssertLockHeld(wallet.cs_wallet);
|
||||||
|
|
||||||
@ -197,7 +197,7 @@ CAmount CachedTxGetAvailableCredit(const CWallet& wallet, const CWalletTx& wtx,
|
|||||||
if (wallet.IsTxImmatureCoinBase(wtx))
|
if (wallet.IsTxImmatureCoinBase(wtx))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (fUseCache && allow_cache && wtx.m_amounts[CWalletTx::AVAILABLE_CREDIT].m_cached[filter]) {
|
if (allow_cache && wtx.m_amounts[CWalletTx::AVAILABLE_CREDIT].m_cached[filter]) {
|
||||||
return wtx.m_amounts[CWalletTx::AVAILABLE_CREDIT].m_value[filter];
|
return wtx.m_amounts[CWalletTx::AVAILABLE_CREDIT].m_value[filter];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -332,8 +332,8 @@ Balance GetBalance(const CWallet& wallet, const int min_depth, bool avoid_reuse)
|
|||||||
const CWalletTx& wtx = entry.second;
|
const CWalletTx& wtx = entry.second;
|
||||||
const bool is_trusted{CachedTxIsTrusted(wallet, wtx, trusted_parents)};
|
const bool is_trusted{CachedTxIsTrusted(wallet, wtx, trusted_parents)};
|
||||||
const int tx_depth{wallet.GetTxDepthInMainChain(wtx)};
|
const int tx_depth{wallet.GetTxDepthInMainChain(wtx)};
|
||||||
const CAmount tx_credit_mine{CachedTxGetAvailableCredit(wallet, wtx, /*fUseCache=*/true, ISMINE_SPENDABLE | reuse_filter)};
|
const CAmount tx_credit_mine{CachedTxGetAvailableCredit(wallet, wtx, ISMINE_SPENDABLE | reuse_filter)};
|
||||||
const CAmount tx_credit_watchonly{CachedTxGetAvailableCredit(wallet, wtx, /*fUseCache=*/true, ISMINE_WATCH_ONLY | reuse_filter)};
|
const CAmount tx_credit_watchonly{CachedTxGetAvailableCredit(wallet, wtx, ISMINE_WATCH_ONLY | reuse_filter)};
|
||||||
if (is_trusted && tx_depth >= min_depth) {
|
if (is_trusted && tx_depth >= min_depth) {
|
||||||
ret.m_mine_trusted += tx_credit_mine;
|
ret.m_mine_trusted += tx_credit_mine;
|
||||||
ret.m_watchonly_trusted += tx_credit_watchonly;
|
ret.m_watchonly_trusted += tx_credit_watchonly;
|
||||||
|
@ -33,7 +33,7 @@ CAmount CachedTxGetImmatureCredit(const CWallet& wallet, const CWalletTx& wtx)
|
|||||||
EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet);
|
EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet);
|
||||||
CAmount CachedTxGetImmatureWatchOnlyCredit(const CWallet& wallet, const CWalletTx& wtx)
|
CAmount CachedTxGetImmatureWatchOnlyCredit(const CWallet& wallet, const CWalletTx& wtx)
|
||||||
EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet);
|
EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet);
|
||||||
CAmount CachedTxGetAvailableCredit(const CWallet& wallet, const CWalletTx& wtx, bool fUseCache = true, const isminefilter& filter = ISMINE_SPENDABLE)
|
CAmount CachedTxGetAvailableCredit(const CWallet& wallet, const CWalletTx& wtx, const isminefilter& filter = ISMINE_SPENDABLE)
|
||||||
EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet);
|
EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet);
|
||||||
struct COutputEntry
|
struct COutputEntry
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user