Skip to content

Commit 04c6423

Browse files
committed
wallet: remove always true 'fUseCache' arg from CachedTxGetAvailableCredit
1 parent 4f0ca9b commit 04c6423

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/wallet/receive.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ CAmount CachedTxGetImmatureWatchOnlyCredit(const CWallet& wallet, const CWalletT
186186
return 0;
187187
}
188188

189-
CAmount CachedTxGetAvailableCredit(const CWallet& wallet, const CWalletTx& wtx, bool fUseCache, const isminefilter& filter)
189+
CAmount CachedTxGetAvailableCredit(const CWallet& wallet, const CWalletTx& wtx, const isminefilter& filter)
190190
{
191191
AssertLockHeld(wallet.cs_wallet);
192192

@@ -197,7 +197,7 @@ CAmount CachedTxGetAvailableCredit(const CWallet& wallet, const CWalletTx& wtx,
197197
if (wallet.IsTxImmatureCoinBase(wtx))
198198
return 0;
199199

200-
if (fUseCache && allow_cache && wtx.m_amounts[CWalletTx::AVAILABLE_CREDIT].m_cached[filter]) {
200+
if (allow_cache && wtx.m_amounts[CWalletTx::AVAILABLE_CREDIT].m_cached[filter]) {
201201
return wtx.m_amounts[CWalletTx::AVAILABLE_CREDIT].m_value[filter];
202202
}
203203

@@ -332,8 +332,8 @@ Balance GetBalance(const CWallet& wallet, const int min_depth, bool avoid_reuse)
332332
const CWalletTx& wtx = entry.second;
333333
const bool is_trusted{CachedTxIsTrusted(wallet, wtx, trusted_parents)};
334334
const int tx_depth{wallet.GetTxDepthInMainChain(wtx)};
335-
const CAmount tx_credit_mine{CachedTxGetAvailableCredit(wallet, wtx, /*fUseCache=*/true, ISMINE_SPENDABLE | reuse_filter)};
336-
const CAmount tx_credit_watchonly{CachedTxGetAvailableCredit(wallet, wtx, /*fUseCache=*/true, ISMINE_WATCH_ONLY | reuse_filter)};
335+
const CAmount tx_credit_mine{CachedTxGetAvailableCredit(wallet, wtx, ISMINE_SPENDABLE | reuse_filter)};
336+
const CAmount tx_credit_watchonly{CachedTxGetAvailableCredit(wallet, wtx, ISMINE_WATCH_ONLY | reuse_filter)};
337337
if (is_trusted && tx_depth >= min_depth) {
338338
ret.m_mine_trusted += tx_credit_mine;
339339
ret.m_watchonly_trusted += tx_credit_watchonly;

src/wallet/receive.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ CAmount CachedTxGetImmatureCredit(const CWallet& wallet, const CWalletTx& wtx)
3333
EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet);
3434
CAmount CachedTxGetImmatureWatchOnlyCredit(const CWallet& wallet, const CWalletTx& wtx)
3535
EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet);
36-
CAmount CachedTxGetAvailableCredit(const CWallet& wallet, const CWalletTx& wtx, bool fUseCache = true, const isminefilter& filter = ISMINE_SPENDABLE)
36+
CAmount CachedTxGetAvailableCredit(const CWallet& wallet, const CWalletTx& wtx, const isminefilter& filter = ISMINE_SPENDABLE)
3737
EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet);
3838
struct COutputEntry
3939
{

0 commit comments

Comments
 (0)