From cf9ec4675f890c0ea7a65fc0c932cb3277688051 Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Thu, 21 Jun 2018 00:38:23 +0300 Subject: [PATCH 1/2] Fix PrepareDenominate If we have exactly nSessionInputCount denoms in our wallet, the mix is going to fail while it should succeed instead. This fixes the issue by checking not the steps we made but the actual number of outputs we created during the loop. --- src/privatesend-client.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/privatesend-client.cpp b/src/privatesend-client.cpp index d202ad3dfd1f..52d8fad64461 100644 --- a/src/privatesend-client.cpp +++ b/src/privatesend-client.cpp @@ -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); From 1402b0b0da0af392e1be4b85c5051ade493631c3 Mon Sep 17 00:00:00 2001 From: InhumanPerfection <39734219+InhumanPerfection@users.noreply.github.com> Date: Wed, 20 Jun 2018 21:31:46 +0300 Subject: [PATCH 2/2] PrepareDenominate fix --- src/privatesend-client.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/privatesend-client.cpp b/src/privatesend-client.cpp index 52d8fad64461..02e43e8d0c85 100644 --- a/src/privatesend-client.cpp +++ b/src/privatesend-client.cpp @@ -1166,8 +1166,8 @@ bool CPrivateSendClient::PrepareDenominate(int nMinRounds, int nMaxRounds, std:: ++it2; } } - if(nValueLeft == 0) break; nStep++; + if(nValueLeft == 0) break; } {