Skip to content

Commit

Permalink
randomly skip some inputs when we have at least one of this denom alr…
Browse files Browse the repository at this point in the history
…eady
  • Loading branch information
UdjinM6 committed Sep 20, 2018
1 parent 617581e commit 33c12af
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/privatesend-client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1289,7 +1289,14 @@ bool CPrivateSendClientSession::PrepareDenominate(int nMinRounds, int nMaxRounds
if (vecSteps[nBit] >= nStepsMax) break;
CAmount nValueDenom = vecStandardDenoms[nBit];
if (pair.second.nValue == nValueDenom) {
CScript scriptDenom = fDryRun ? CScript() : keyHolderStorage.AddKey(pwalletMain);
CScript scriptDenom;
if (fDryRun) {
scriptDenom = CScript();
} else {
// randomly skip some inputs when we have at least one of the same denom already
if (vecSteps[nBit] > 1 && GetRandInt(2)) break;
scriptDenom = keyHolderStorage.AddKey(pwalletMain);
}
vecPSInOutPairsRet.emplace_back(pair.first, CTxOut(nValueDenom, scriptDenom));
fFound = true;
nDenomResult |= 1 << nBit;
Expand Down

0 comments on commit 33c12af

Please sign in to comment.