Skip to content

Commit 77ed583

Browse files
committed
Merge pull request #4520
39cc492 Fix Watchonly: cs_main lock not held (Cozz Lovan)
2 parents 3554df9 + 39cc492 commit 77ed583

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/wallet.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1075,7 +1075,7 @@ int64_t CWallet::GetWatchOnlyBalance() const
10751075
{
10761076
int64_t nTotal = 0;
10771077
{
1078-
LOCK(cs_wallet);
1078+
LOCK2(cs_main, cs_wallet);
10791079
for (map<uint256, CWalletTx>::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it)
10801080
{
10811081
const CWalletTx* pcoin = &(*it).second;
@@ -1091,7 +1091,7 @@ int64_t CWallet::GetUnconfirmedWatchOnlyBalance() const
10911091
{
10921092
int64_t nTotal = 0;
10931093
{
1094-
LOCK(cs_wallet);
1094+
LOCK2(cs_main, cs_wallet);
10951095
for (map<uint256, CWalletTx>::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it)
10961096
{
10971097
const CWalletTx* pcoin = &(*it).second;
@@ -1106,7 +1106,7 @@ int64_t CWallet::GetImmatureWatchOnlyBalance() const
11061106
{
11071107
int64_t nTotal = 0;
11081108
{
1109-
LOCK(cs_wallet);
1109+
LOCK2(cs_main, cs_wallet);
11101110
for (map<uint256, CWalletTx>::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it)
11111111
{
11121112
const CWalletTx* pcoin = &(*it).second;

0 commit comments

Comments
 (0)