Add missing locks after backporting 12333 (#3587)

This commit is contained in:
UdjinM6 2020-07-07 09:06:59 +03:00 committed by GitHub
parent c59dafb708
commit 497c3fbc85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

View File

@ -225,6 +225,8 @@ UniValue masternode_outputs(const JSONRPCRequest& request)
if (!EnsureWalletIsAvailable(pwallet, request.fHelp))
return NullUniValue;
LOCK2(cs_main, pwallet->cs_wallet);
// Find possible candidates
std::vector<COutput> vPossibleCoins;
CCoinControl coin_control;

View File

@ -3313,6 +3313,8 @@ bool CWallet::FundTransaction(CMutableTransaction& tx, CAmount& nFeeRet, int& nC
bool CWallet::SelectPSInOutPairsByDenominations(int nDenom, CAmount nValueMax, std::vector< std::pair<CTxDSIn, CTxOut> >& vecPSInOutPairsRet)
{
LOCK2(cs_main, cs_wallet);
CAmount nValueTotal{0};
std::set<uint256> setRecentTxIds;
@ -3460,6 +3462,8 @@ bool CWallet::SelectCoinsGroupedByAddresses(std::vector<CompactTallyItem>& vecTa
bool CWallet::SelectDenominatedAmounts(CAmount nValueMax, std::set<CAmount>& setAmountsRet) const
{
LOCK2(cs_main, cs_wallet);
CAmount nValueTotal{0};
setAmountsRet.clear();
@ -3503,6 +3507,8 @@ bool CWallet::GetCollateralTxDSIn(CTxDSIn& txdsinRet, CAmount& nValueRet) const
bool CWallet::GetMasternodeOutpointAndKeys(COutPoint& outpointRet, CPubKey& pubKeyRet, CKey& keyRet, const std::string& strTxHash, const std::string& strOutputIndex)
{
LOCK2(cs_main, cs_wallet);
// wait for reindex and/or import to finish
if (fImporting || fReindex) return false;
@ -3579,6 +3585,8 @@ int CWallet::CountInputsWithAmount(CAmount nInputAmount) const
bool CWallet::HasCollateralInputs(bool fOnlyConfirmed) const
{
LOCK2(cs_main, cs_wallet);
std::vector<COutput> vCoins;
CCoinControl coin_control;
coin_control.nCoinType = CoinType::ONLY_PRIVATESEND_COLLATERAL;