aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/wallet/wallet.cpp')
-rw-r--r--src/wallet/wallet.cpp12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp
index d3ccd2dfaa..6cbfbc1f90 100644
--- a/src/wallet/wallet.cpp
+++ b/src/wallet/wallet.cpp
@@ -2252,20 +2252,12 @@ void CWallet::AvailableCoins(std::vector<COutput> &vCoins, bool fOnlySafe, const
std::map<CTxDestination, std::vector<COutput>> CWallet::ListCoins() const
{
- // TODO: Add AssertLockHeld(cs_wallet) here.
- //
- // Because the return value from this function contains pointers to
- // CWalletTx objects, callers to this function really should acquire the
- // cs_wallet lock before calling it. However, the current caller doesn't
- // acquire this lock yet. There was an attempt to add the missing lock in
- // https://github.com/bitcoin/bitcoin/pull/10340, but that change has been
- // postponed until after https://github.com/bitcoin/bitcoin/pull/10244 to
- // avoid adding some extra complexity to the Qt code.
+ AssertLockHeld(cs_main);
+ AssertLockHeld(cs_wallet);
std::map<CTxDestination, std::vector<COutput>> result;
std::vector<COutput> availableCoins;
- LOCK2(cs_main, cs_wallet);
AvailableCoins(availableCoins);
for (auto& coin : availableCoins) {