mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 12:32:48 +01:00
Limit the scope of cs_wallet lock in CPrivateSendClient::PrepareDenominate() (#1997)
This commit is contained in:
parent
a3bcc4307d
commit
4d442376e9
@ -1141,11 +1141,13 @@ bool CPrivateSendClient::PrepareDenominate(int nMinRounds, int nMaxRounds, std::
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (CPrivateSend::GetDenominations(vecTxOutRet) != nSessionDenom) {
|
if (CPrivateSend::GetDenominations(vecTxOutRet) != nSessionDenom) {
|
||||||
|
{
|
||||||
// unlock used coins on failure
|
// unlock used coins on failure
|
||||||
LOCK(pwalletMain->cs_wallet);
|
LOCK(pwalletMain->cs_wallet);
|
||||||
for (const auto& txin : vecTxDSInRet) {
|
for (const auto& txin : vecTxDSInRet) {
|
||||||
pwalletMain->UnlockCoin(txin.prevout);
|
pwalletMain->UnlockCoin(txin.prevout);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
keyHolderStorage.ReturnAll();
|
keyHolderStorage.ReturnAll();
|
||||||
strErrorRet = "Can't make current denominated outputs";
|
strErrorRet = "Can't make current denominated outputs";
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user