Fix an edge case in PrepareDenominate (#2138)

* PrepareDenominate fix

* Fix conditions
This commit is contained in:
InhumanPerfection 2018-06-22 18:57:46 +03:00 committed by UdjinM6
parent 8e6364694f
commit 0d5426343d

View File

@ -1166,8 +1166,8 @@ bool CPrivateSendClient::PrepareDenominate(int nMinRounds, int nMaxRounds, std::
++it2;
}
}
if(nValueLeft == 0) break;
nStep++;
if(nValueLeft == 0) break;
}
{
@ -1178,7 +1178,7 @@ bool CPrivateSendClient::PrepareDenominate(int nMinRounds, int nMaxRounds, std::
}
}
if (CPrivateSend::GetDenominations(vecTxOutRet) != nSessionDenom || (nSessionInputCount != 0 && nStep != nStepsMax)) {
if (CPrivateSend::GetDenominations(vecTxOutRet) != nSessionDenom || (nSessionInputCount != 0 && vecTxOutRet.size() != nSessionInputCount)) {
{
// unlock used coins on failure
LOCK(pwalletMain->cs_wallet);