Skip to content

Commit 6729d69

Browse files
committed
fix: add missing lock annotation in lambda expression
Also, add `AssertLockHeld` to corresponding `EXCLUSIVE_LOCKS_REQUIRED`
1 parent f6d1eb9 commit 6729d69

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/wallet/rpcwallet.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -952,6 +952,8 @@ struct tallyitem
952952

953953
static UniValue ListReceived(const CWallet& wallet, const UniValue& params, const bool by_label, const bool include_immature_coinbase) EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet)
954954
{
955+
AssertLockHeld(wallet.cs_wallet);
956+
955957
// Minimum confirmations
956958
int nMinDepth = 1;
957959
if (!params[0].isNull())
@@ -1029,7 +1031,11 @@ static UniValue ListReceived(const CWallet& wallet, const UniValue& params, cons
10291031
UniValue ret(UniValue::VARR);
10301032
std::map<std::string, tallyitem> label_tally;
10311033

1032-
const auto& func = [&](const CTxDestination& address, const std::string& label, const std::string& purpose, bool is_change) {
1034+
const auto& func = [&](const CTxDestination& address, const std::string& label, const std::string& purpose, bool is_change)
1035+
EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet)
1036+
{
1037+
AssertLockHeld(wallet.cs_wallet);
1038+
10331039
if (is_change) return; // no change addresses
10341040
auto it = mapTally.find(address);
10351041
if (it == mapTally.end() && !fIncludeEmpty)

0 commit comments

Comments
 (0)