Merge pull request #5521 from nuttycom/fix_z_getbalance_locking

Fix locking in z_getbalanceforaddress and z_getbalanceforaccount
This commit is contained in:
Kris Nuttycombe 2022-02-09 12:30:25 -07:00 committed by GitHub
commit 08dd842087
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -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);