From 5b2f7a6ea7d62a7a5dc7c0790d62948c9590ca49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Barbosa?= Date: Fri, 2 Feb 2018 11:37:50 +0000 Subject: [PATCH] [wallet] Make CWallet::ListCoins atomic zcash: Not an actual locking fix; just eliminates unnecessary recursive zcash: locking (which is a long-term goal). zcash: cherry picked from commit 1beea7af92994dca83facb11bbef82b24b538400 zcash: https://github.com/bitcoin/bitcoin/pull/12333 --- src/wallet/wallet.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 1cede9905..92b5ac898 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -3227,10 +3227,12 @@ void CWallet::AvailableCoins(vector& vCoins, std::set* onlyFilterByDests) const { assert(nMinDepth >= 0); + AssertLockHeld(cs_main); + AssertLockHeld(cs_wallet); + vCoins.clear(); { - LOCK2(cs_main, cs_wallet); for (map::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it) { const uint256& wtxid = it->first;