mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-05-29 21:42:32 +02:00
Add proper thread safety annotation to CachedTxGetAvailableCredit()
This commit is contained in:
parent
187504b038
commit
ca446f2c59
@ -182,6 +182,8 @@ CAmount CachedTxGetImmatureWatchOnlyCredit(const CWallet& wallet, const CWalletT
|
|||||||
|
|
||||||
CAmount CachedTxGetAvailableCredit(const CWallet& wallet, const CWalletTx& wtx, bool fUseCache, const isminefilter& filter)
|
CAmount CachedTxGetAvailableCredit(const CWallet& wallet, const CWalletTx& wtx, bool fUseCache, const isminefilter& filter)
|
||||||
{
|
{
|
||||||
|
AssertLockHeld(wallet.cs_wallet);
|
||||||
|
|
||||||
// Avoid caching ismine for NO or ALL cases (could remove this check and simplify in the future).
|
// Avoid caching ismine for NO or ALL cases (could remove this check and simplify in the future).
|
||||||
bool allow_cache = (filter & ISMINE_ALL) && (filter & ISMINE_ALL) != ISMINE_ALL;
|
bool allow_cache = (filter & ISMINE_ALL) && (filter & ISMINE_ALL) != ISMINE_ALL;
|
||||||
|
|
||||||
|
@ -30,11 +30,8 @@ CAmount CachedTxGetDebit(const CWallet& wallet, const CWalletTx& wtx, const ismi
|
|||||||
CAmount CachedTxGetChange(const CWallet& wallet, const CWalletTx& wtx);
|
CAmount CachedTxGetChange(const CWallet& wallet, const CWalletTx& wtx);
|
||||||
CAmount CachedTxGetImmatureCredit(const CWallet& wallet, const CWalletTx& wtx, bool fUseCache = true);
|
CAmount CachedTxGetImmatureCredit(const CWallet& wallet, const CWalletTx& wtx, bool fUseCache = true);
|
||||||
CAmount CachedTxGetImmatureWatchOnlyCredit(const CWallet& wallet, const CWalletTx& wtx, const bool fUseCache = true);
|
CAmount CachedTxGetImmatureWatchOnlyCredit(const CWallet& wallet, const CWalletTx& wtx, const bool fUseCache = true);
|
||||||
// TODO: Remove "NO_THREAD_SAFETY_ANALYSIS" and replace it with the correct
|
CAmount CachedTxGetAvailableCredit(const CWallet& wallet, const CWalletTx& wtx, bool fUseCache = true, const isminefilter& filter = ISMINE_SPENDABLE)
|
||||||
// annotation "EXCLUSIVE_LOCKS_REQUIRED(pwallet->cs_wallet)". The
|
EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet);
|
||||||
// annotation "NO_THREAD_SAFETY_ANALYSIS" was temporarily added to avoid
|
|
||||||
// having to resolve the issue of member access into incomplete type CWallet.
|
|
||||||
CAmount CachedTxGetAvailableCredit(const CWallet& wallet, const CWalletTx& wtx, bool fUseCache = true, const isminefilter& filter = ISMINE_SPENDABLE) NO_THREAD_SAFETY_ANALYSIS;
|
|
||||||
struct COutputEntry
|
struct COutputEntry
|
||||||
{
|
{
|
||||||
CTxDestination destination;
|
CTxDestination destination;
|
||||||
|
Loading…
Reference in New Issue
Block a user