From 39cc4922fe30a93d10665d913e2e3d51fb94561a Mon Sep 17 00:00:00 2001 From: Cozz Lovan Date: Sun, 13 Jul 2014 09:33:45 +0200 Subject: [PATCH] Fix Watchonly: cs_main lock not held --- src/wallet.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/wallet.cpp b/src/wallet.cpp index 8fdc5f4b20..560cbc10b9 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -1075,7 +1075,7 @@ int64_t CWallet::GetWatchOnlyBalance() const { int64_t nTotal = 0; { - LOCK(cs_wallet); + LOCK2(cs_main, cs_wallet); for (map::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it) { const CWalletTx* pcoin = &(*it).second; @@ -1091,7 +1091,7 @@ int64_t CWallet::GetUnconfirmedWatchOnlyBalance() const { int64_t nTotal = 0; { - LOCK(cs_wallet); + LOCK2(cs_main, cs_wallet); for (map::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it) { const CWalletTx* pcoin = &(*it).second; @@ -1106,7 +1106,7 @@ int64_t CWallet::GetImmatureWatchOnlyBalance() const { int64_t nTotal = 0; { - LOCK(cs_wallet); + LOCK2(cs_main, cs_wallet); for (map::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it) { const CWalletTx* pcoin = &(*it).second;