Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DS: try to use only inputs with the same number of rounds starting from lowest number of rounds possible #607

Merged
merged 1 commit into from
Sep 15, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions src/darksend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1625,12 +1625,21 @@ bool CDarksendPool::DoAutomaticDenominating(bool fDryRun)

bool CDarksendPool::PrepareDarksendDenominate()
{
// Submit transaction to the pool if we get here, use sessionDenom so we use the same amount of money
std::string strError = pwalletMain->PrepareDarksendDenominate(0, nDarksendRounds);
LogPrintf("DoAutomaticDenominating : Running Darksend denominate. Return '%s'\n", strError);

std::string strError = "";
// Submit transaction to the pool if we get here
// Try to use only inputs with the same number of rounds starting from lowest number of rounds possible
for(int i = 0; i < nDarksendRounds; i++) {
strError = pwalletMain->PrepareDarksendDenominate(i, i+1);
LogPrintf("DoAutomaticDenominating : Running Darksend denominate for %d rounds. Return '%s'\n", i, strError);
if(strError == "") return true;
}

// We failed? That's strange but let's just make final attempt and try to mix everything
strError = pwalletMain->PrepareDarksendDenominate(0, nDarksendRounds);
LogPrintf("DoAutomaticDenominating : Running Darksend denominate for all rounds. Return '%s'\n", strError);
if(strError == "") return true;

// Should never actually get here but just in case
strAutoDenomResult = strError;
LogPrintf("DoAutomaticDenominating : Error running denominate, %s\n", strError);
return false;
Expand Down