diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index f3af9885a2..1216bf5e08 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -2191,7 +2191,7 @@ void CWallet::MarkDestinationsDirty(const std::set& destinations std::set CWallet::GetLabelAddresses(const std::string& label) const { - LOCK(cs_wallet); + AssertLockHeld(cs_wallet); std::set result; for (const std::pair& item : m_address_book) { diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h index fbeec2aa30..48efbbfde6 100644 --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -630,7 +630,7 @@ public: int64_t GetOldestKeyPoolTime() const; - std::set GetLabelAddresses(const std::string& label) const; + std::set GetLabelAddresses(const std::string& label) const EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); /** * Marks all outputs in each one of the destinations dirty, so their cache is