Skip to content

Commit

Permalink
Add AssertLockHeld to suppress clang error
Browse files Browse the repository at this point in the history
clang showed the following error:
wallet/wallet.cpp:2577:17: error: calling function 'IsLockedCoin'
  requires holding mutex 'cs_wallet' exclusively
  [-Werror,-Wthread-safety-analysis]
            if (IsLockedCoin(entry.first, i)) {
                ^

Signed-off-by: Azat Nizametdinov <azat@thirdhash.com>
  • Loading branch information
Nizametdinov committed May 22, 2019
1 parent df6c75d commit 5320157
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2562,6 +2562,9 @@ void CWallet::AvailableCoins(std::vector<COutput> &vCoins, bool fOnlySafe, const

bool done = false;
m_wallet_extension.ForEachMatureOutput(*pcoin->tx, block, nDepth, [&](const CTxOut &out, std::size_t i) {
AssertLockHeld(cs_main);
AssertLockHeld(cs_wallet);

if (done) {
return;
}
Expand Down

0 comments on commit 5320157

Please sign in to comment.