From 841fc5fbae040785185d9476391fd5f2f8477ddf Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Tue, 15 Sep 2015 20:40:36 +0300 Subject: [PATCH] DS MultiSession cmd-line option (try to mix constantly, few times per block) --- src/darksend.cpp | 4 ++-- src/init.cpp | 3 +++ src/util.cpp | 1 + src/util.h | 1 + 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/darksend.cpp b/src/darksend.cpp index 7b0487e069..4712c2dd50 100644 --- a/src/darksend.cpp +++ b/src/darksend.cpp @@ -1382,7 +1382,7 @@ bool CDarksendPool::DoAutomaticDenominating(bool fDryRun) return false; } - if(chainActive.Tip()->nHeight - cachedLastSuccess < minBlockSpacing) { + if(!fDarksendMultiSession && chainActive.Tip()->nHeight - cachedLastSuccess < minBlockSpacing) { LogPrintf("CDarksendPool::DoAutomaticDenominating - Last successful Darksend action was too recent\n"); strAutoDenomResult = _("Last successful Darksend action was too recent."); return false; @@ -1475,7 +1475,7 @@ bool CDarksendPool::DoAutomaticDenominating(bool fDryRun) int nUseQueue = rand()%100; UpdateState(POOL_STATUS_ACCEPTING_ENTRIES); - if(pwalletMain->GetDenominatedBalance(true) > 0){ //get denominated unconfirmed inputs + if(!fDarksendMultiSession && pwalletMain->GetDenominatedBalance(true) > 0) { //get denominated unconfirmed inputs LogPrintf("DoAutomaticDenominating -- Found unconfirmed denominated outputs, will wait till they confirm to continue.\n"); strAutoDenomResult = _("Found unconfirmed denominated outputs, will wait till they confirm to continue."); return false; diff --git a/src/init.cpp b/src/init.cpp index 901f739794..722a9896ea 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -419,6 +419,7 @@ std::string HelpMessage(HelpMessageMode mode) strUsage += "\n" + _("Darksend options:") + "\n"; strUsage += " -enabledarksend= " + strprintf(_("Enable use of automated darksend for funds stored in this wallet (0-1, default: %u)"), 0) + "\n"; + strUsage += " -darksendmultisession= " + strprintf(_("Enable multiple darksend mixing sessions per block, experimental (0-1, default: %u)"), 0) + "\n"; strUsage += " -darksendrounds= " + strprintf(_("Use N separate masternodes to anonymize funds (2-8, default: %u)"), 2) + "\n"; strUsage += " -anonymizedashamount= " + strprintf(_("Keep N DASH anonymized (default: %u)"), 0) + "\n"; strUsage += " -liquidityprovider= " + strprintf(_("Provide liquidity to Darksend by infrequently mixing coins on a continual basis (0-100, default: %u, 1=very frequent, high fees, 100=very infrequent, low fees)"), 0) + "\n"; @@ -1516,6 +1517,7 @@ bool AppInit2(boost::thread_group& threadGroup) } fEnableDarksend = GetBoolArg("-enabledarksend", false); + fDarksendMultiSession = GetBoolArg("-darksendmultisession", false); nDarksendRounds = GetArg("-darksendrounds", 2); if(nDarksendRounds > 16) nDarksendRounds = 16; @@ -1526,6 +1528,7 @@ bool AppInit2(boost::thread_group& threadGroup) darkSendPool.SetMinBlockSpacing(std::min(nLiquidityProvider,100)*15); fEnableDarksend = true; nDarksendRounds = 99999; + fDarksendMultiSession = false; } nAnonymizeDarkcoinAmount = GetArg("-anonymizedashamount", 0); diff --git a/src/util.cpp b/src/util.cpp index 62c305a114..0beeb64e75 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -116,6 +116,7 @@ int nLiquidityProvider = 0; int64_t enforceMasternodePaymentsTime = 4085657524; bool fSucessfullyLoaded = false; bool fEnableDarksend = false; +bool fDarksendMultiSession = false; /** All denominations used by darksend */ std::vector darkSendDenominations; string strBudgetMode = ""; diff --git a/src/util.h b/src/util.h index 93f6db4470..f4f9578711 100644 --- a/src/util.h +++ b/src/util.h @@ -37,6 +37,7 @@ extern int nDarksendRounds; extern int nAnonymizeDarkcoinAmount; extern int nLiquidityProvider; extern bool fEnableDarksend; +extern bool fDarksendMultiSession; extern int64_t enforceMasternodePaymentsTime; extern std::string strMasterNodeAddr; extern int keysLoaded;