@@ -164,23 +164,12 @@ CAmount CachedTxGetChange(const CWallet& wallet, const CWalletTx& wtx)
164
164
return wtx.nChangeCached ;
165
165
}
166
166
167
- CAmount CachedTxGetImmatureCredit (const CWallet& wallet, const CWalletTx& wtx)
167
+ CAmount CachedTxGetImmatureCredit (const CWallet& wallet, const CWalletTx& wtx, const isminefilter& filter )
168
168
{
169
169
AssertLockHeld (wallet.cs_wallet );
170
170
171
171
if (wallet.IsTxImmatureCoinBase (wtx) && wallet.IsTxInMainChain (wtx)) {
172
- return GetCachableAmount (wallet, wtx, CWalletTx::IMMATURE_CREDIT, ISMINE_SPENDABLE);
173
- }
174
-
175
- return 0 ;
176
- }
177
-
178
- CAmount CachedTxGetImmatureWatchOnlyCredit (const CWallet& wallet, const CWalletTx& wtx)
179
- {
180
- AssertLockHeld (wallet.cs_wallet );
181
-
182
- if (wallet.IsTxImmatureCoinBase (wtx) && wallet.IsTxInMainChain (wtx)) {
183
- return GetCachableAmount (wallet, wtx, CWalletTx::IMMATURE_CREDIT, ISMINE_WATCH_ONLY);
172
+ return GetCachableAmount (wallet, wtx, CWalletTx::IMMATURE_CREDIT, filter);
184
173
}
185
174
186
175
return 0 ;
@@ -342,8 +331,8 @@ Balance GetBalance(const CWallet& wallet, const int min_depth, bool avoid_reuse)
342
331
ret.m_mine_untrusted_pending += tx_credit_mine;
343
332
ret.m_watchonly_untrusted_pending += tx_credit_watchonly;
344
333
}
345
- ret.m_mine_immature += CachedTxGetImmatureCredit (wallet, wtx);
346
- ret.m_watchonly_immature += CachedTxGetImmatureWatchOnlyCredit (wallet, wtx);
334
+ ret.m_mine_immature += CachedTxGetImmatureCredit (wallet, wtx, ISMINE_SPENDABLE );
335
+ ret.m_watchonly_immature += CachedTxGetImmatureCredit (wallet, wtx, ISMINE_WATCH_ONLY );
347
336
}
348
337
}
349
338
return ret;
0 commit comments