From ae1b843b5ac51746837c95230a51afcbcb223d0e Mon Sep 17 00:00:00 2001 From: Kris Nuttycombe Date: Wed, 9 Feb 2022 10:48:12 -0700 Subject: [PATCH] Fix locking in z_getbalanceforaddress and z_getbalanceforaccount --- src/wallet/rpcwallet.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 18b9cd0ab..b9dcf38d2 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -3678,7 +3678,7 @@ UniValue z_getbalanceforaddress(const UniValue& params, bool fHelp) } } - LOCK(pwalletMain->cs_wallet); + LOCK2(cs_main, pwalletMain->cs_wallet); // Get the receivers for this address. auto selector = pwalletMain->ToZTXOSelector(address, false); @@ -3780,7 +3780,7 @@ UniValue z_getbalanceforaccount(const UniValue& params, bool fHelp) } } - LOCK(pwalletMain->cs_wallet); + LOCK2(cs_main, pwalletMain->cs_wallet); // Get the receivers for this account. auto selector = pwalletMain->ZTXOSelectorForAccount(account, false);