diff --git a/src/init.cpp b/src/init.cpp index 25f0cf443577d..7185034792502 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -559,7 +559,7 @@ std::string HelpMessage(HelpMessageMode mode) strUsage += HelpMessageOpt("-enableprivatesend=", strprintf(_("Enable use of automated PrivateSend for funds stored in this wallet (0-1, default: %u)"), fEnablePrivateSend)); strUsage += HelpMessageOpt("-privatesendmultisession=", strprintf(_("Enable multiple PrivateSend mixing sessions per block, experimental (0-1, default: %u)"), fPrivateSendMultiSession)); strUsage += HelpMessageOpt("-privatesendrounds=", strprintf(_("Use N separate masternodes to anonymize funds (2-8, default: %u)"), nPrivateSendRounds)); - strUsage += HelpMessageOpt("-anonymizedashamount=", strprintf(_("Keep N DASH anonymized (default: %u)"), nAnonymizeDashAmount)); + strUsage += HelpMessageOpt("-privatesendamount=", strprintf(_("Keep N DASH anonymized (default: %u)"), nPrivateSendAmount)); strUsage += HelpMessageOpt("-liquidityprovider=", strprintf(_("Provide liquidity to PrivateSend by infrequently mixing coins on a continual basis (0-100, default: %u, 1=very frequent, high fees, 100=very infrequent, low fees)"), nLiquidityProvider)); strUsage += HelpMessageGroup(_("InstantSend options:")); @@ -866,8 +866,8 @@ void InitParameterInteraction() LogPrintf("AppInit2 : parameter interaction: -liquidityprovider=%d -> setting -enableprivatesend=1\n", nLiqProvTmp); mapArgs["-privatesendrounds"] = "99999"; LogPrintf("AppInit2 : parameter interaction: -liquidityprovider=%d -> setting -privatesendrounds=99999\n", nLiqProvTmp); - mapArgs["-anonymizedashamount"] = "999999"; - LogPrintf("AppInit2 : parameter interaction: -liquidityprovider=%d -> setting -anonymizedashamount=999999\n", nLiqProvTmp); + mapArgs["-privatesendamount"] = "999999"; + LogPrintf("AppInit2 : parameter interaction: -liquidityprovider=%d -> setting -privatesendamount=999999\n", nLiqProvTmp); mapArgs["-privatesendmultisession"] = "0"; LogPrintf("AppInit2 : parameter interaction: -liquidityprovider=%d -> setting -privatesendmultisession=0\n", nLiqProvTmp); } @@ -1829,8 +1829,8 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) fPrivateSendMultiSession = GetBoolArg("-privatesendmultisession", fPrivateSendMultiSession); nPrivateSendRounds = GetArg("-privatesendrounds", nPrivateSendRounds); nPrivateSendRounds = std::min(std::max(nPrivateSendRounds, 1), 99999); - nAnonymizeDashAmount = GetArg("-anonymizedashamount", nAnonymizeDashAmount); - nAnonymizeDashAmount = std::min(std::max(nAnonymizeDashAmount, 2), 999999); + nPrivateSendAmount = GetArg("-privatesendamount", nPrivateSendAmount); + nPrivateSendAmount = std::min(std::max(nPrivateSendAmount, 2), 999999); fEnableInstantSend = GetBoolArg("-enableinstantsend", fEnableInstantSend); nInstantSendDepth = GetArg("-instantsenddepth", nInstantSendDepth); @@ -1845,7 +1845,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) LogPrintf("fLiteMode %d\n", fLiteMode); LogPrintf("nInstantSendDepth %d\n", nInstantSendDepth); LogPrintf("PrivateSend rounds %d\n", nPrivateSendRounds); - LogPrintf("Anonymize Dash Amount %d\n", nAnonymizeDashAmount); + LogPrintf("PrivateSend amount %d\n", nPrivateSendAmount); LogPrintf("Budget Mode %s\n", strBudgetMode); darkSendPool.InitDenominations(); diff --git a/src/qt/darksendconfig.cpp b/src/qt/darksendconfig.cpp index 5d06751ba3230..09c2dc2e98e8a 100644 --- a/src/qt/darksendconfig.cpp +++ b/src/qt/darksendconfig.cpp @@ -84,8 +84,8 @@ void DarksendConfig::configure(bool enabled, int coins, int rounds) { QSettings settings; settings.setValue("nPrivateSendRounds", rounds); - settings.setValue("nAnonymizeDashAmount", coins); + settings.setValue("nPrivateSendAmount", coins); nPrivateSendRounds = rounds; - nAnonymizeDashAmount = coins; + nPrivateSendAmount = coins; } diff --git a/src/qt/forms/optionsdialog.ui b/src/qt/forms/optionsdialog.ui index 2394eca0aa867..567a082fe5dda 100644 --- a/src/qt/forms/optionsdialog.ui +++ b/src/qt/forms/optionsdialog.ui @@ -248,7 +248,7 @@ - + 2 diff --git a/src/qt/optionsdialog.cpp b/src/qt/optionsdialog.cpp index 961d389b7585e..9e6bb16eeb937 100644 --- a/src/qt/optionsdialog.cpp +++ b/src/qt/optionsdialog.cpp @@ -200,7 +200,7 @@ void OptionsDialog::setMapper() mapper->addMapping(ui->showAdvancedPSUI, OptionsModel::ShowAdvancedPSUI); mapper->addMapping(ui->coinControlFeatures, OptionsModel::CoinControlFeatures); mapper->addMapping(ui->privateSendRounds, OptionsModel::PrivateSendRounds); - mapper->addMapping(ui->anonymizeDash, OptionsModel::AnonymizeDashAmount); + mapper->addMapping(ui->privateSendAmount, OptionsModel::PrivateSendAmount); mapper->addMapping(ui->privateSendMultiSession, OptionsModel::PrivateSendMultiSession); /* Network */ diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp index 2889768177e81..a5acd9a3559a4 100644 --- a/src/qt/optionsmodel.cpp +++ b/src/qt/optionsmodel.cpp @@ -121,16 +121,16 @@ void OptionsModel::Init(bool resetSettings) addOverriddenOption("-privatesendrounds"); nPrivateSendRounds = settings.value("nPrivateSendRounds").toInt(); - if (!settings.contains("nAnonymizeDashAmount")) { + if (!settings.contains("nPrivateSendAmount")) { // for migration from old settings - if (!settings.contains("nAnonymizeDarkcoinAmount")) - settings.setValue("nAnonymizeDashAmount", 1000); + if (!settings.contains("nAnonymizeDashAmount")) + settings.setValue("nPrivateSendAmount", 1000); else - settings.setValue("nAnonymizeDashAmount", settings.value("nAnonymizeDarkcoinAmount").toInt()); + settings.setValue("nPrivateSendAmount", settings.value("nAnonymizeDashAmount").toInt()); } - if (!SoftSetArg("-anonymizedashamount", settings.value("nAnonymizeDashAmount").toString().toStdString())) - addOverriddenOption("-anonymizedashamount"); - nAnonymizeDashAmount = settings.value("nAnonymizeDashAmount").toInt(); + if (!SoftSetArg("-privatesendamount", settings.value("nPrivateSendAmount").toString().toStdString())) + addOverriddenOption("-privatesendamount"); + nPrivateSendAmount = settings.value("nPrivateSendAmount").toInt(); if (!settings.contains("fPrivateSendMultiSession")) settings.setValue("fPrivateSendMultiSession", fPrivateSendMultiSession); @@ -253,8 +253,8 @@ QVariant OptionsModel::data(const QModelIndex & index, int role) const return fShowAdvancedPSUI; case PrivateSendRounds: return settings.value("nPrivateSendRounds"); - case AnonymizeDashAmount: - return settings.value("nAnonymizeDashAmount"); + case PrivateSendAmount: + return settings.value("nPrivateSendAmount"); case ShowMasternodesTab: return settings.value("fShowMasternodesTab"); case PrivateSendMultiSession: @@ -394,12 +394,12 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in Q_EMIT privateSendRoundsChanged(); } break; - case AnonymizeDashAmount: - if (settings.value("nAnonymizeDashAmount") != value) + case PrivateSendAmount: + if (settings.value("nPrivateSendAmount") != value) { - nAnonymizeDashAmount = value.toInt(); - settings.setValue("nAnonymizeDashAmount", nAnonymizeDashAmount); - Q_EMIT anonymizeDashAmountChanged(); + nPrivateSendAmount = value.toInt(); + settings.setValue("nPrivateSendAmount", nPrivateSendAmount); + Q_EMIT privateSentAmountChanged(); } break; case ShowMasternodesTab: diff --git a/src/qt/optionsmodel.h b/src/qt/optionsmodel.h index 613c8adc43a64..e9302b3bca046 100644 --- a/src/qt/optionsmodel.h +++ b/src/qt/optionsmodel.h @@ -48,7 +48,7 @@ class OptionsModel : public QAbstractListModel SpendZeroConfChange, // bool ShowAdvancedPSUI, // bool PrivateSendRounds, // int - AnonymizeDashAmount, // int + PrivateSendAmount, // int ShowMasternodesTab, // bool PrivateSendMultiSession,// bool Listen, // bool @@ -97,7 +97,7 @@ class OptionsModel : public QAbstractListModel Q_SIGNALS: void displayUnitChanged(int unit); void privateSendRoundsChanged(); - void anonymizeDashAmountChanged(); + void privateSentAmountChanged(); void advancedPSUIChanged(bool); void coinControlFeaturesChanged(bool); }; diff --git a/src/qt/overviewpage.cpp b/src/qt/overviewpage.cpp index 67e6718aa1ccb..a3131191b4e95 100644 --- a/src/qt/overviewpage.cpp +++ b/src/qt/overviewpage.cpp @@ -275,7 +275,7 @@ void OverviewPage::setWalletModel(WalletModel *model) connect(model->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit())); connect(model->getOptionsModel(), SIGNAL(privateSendRoundsChanged()), this, SLOT(updatePrivateSendProgress())); - connect(model->getOptionsModel(), SIGNAL(anonymizeDashAmountChanged()), this, SLOT(updatePrivateSendProgress())); + connect(model->getOptionsModel(), SIGNAL(privateSentAmountChanged()), this, SLOT(updatePrivateSendProgress())); connect(model->getOptionsModel(), SIGNAL(advancedPSUIChanged(bool)), this, SLOT(updateAdvancedPSUI(bool))); // explicitly update PS frame and transaction list to reflect actual settings updateAdvancedPSUI(model->getOptionsModel()->getShowAdvancedPSUI()); @@ -327,7 +327,7 @@ void OverviewPage::updatePrivateSendProgress() if(!pwalletMain) return; QString strAmountAndRounds; - QString strAnonymizeDashAmount = BitcoinUnits::formatHtmlWithUnit(nDisplayUnit, nAnonymizeDashAmount * COIN, false, BitcoinUnits::separatorAlways); + QString strPrivateSendAmount = BitcoinUnits::formatHtmlWithUnit(nDisplayUnit, nPrivateSendAmount * COIN, false, BitcoinUnits::separatorAlways); if(currentBalance == 0) { @@ -335,8 +335,8 @@ void OverviewPage::updatePrivateSendProgress() ui->privateSendProgress->setToolTip(tr("No inputs detected")); // when balance is zero just show info from settings - strAnonymizeDashAmount = strAnonymizeDashAmount.remove(strAnonymizeDashAmount.indexOf("."), BitcoinUnits::decimals(nDisplayUnit) + 1); - strAmountAndRounds = strAnonymizeDashAmount + " / " + tr("%n Rounds", "", nPrivateSendRounds); + strPrivateSendAmount = strPrivateSendAmount.remove(strPrivateSendAmount.indexOf("."), BitcoinUnits::decimals(nDisplayUnit) + 1); + strAmountAndRounds = strPrivateSendAmount + " / " + tr("%n Rounds", "", nPrivateSendRounds); ui->labelAmountRounds->setToolTip(tr("No inputs detected")); ui->labelAmountRounds->setText(strAmountAndRounds); @@ -360,20 +360,20 @@ void OverviewPage::updatePrivateSendProgress() CAmount nMaxToAnonymize = nAnonymizableBalance + currentAnonymizedBalance + nDenominatedUnconfirmedBalance; // If it's more than the anon threshold, limit to that. - if(nMaxToAnonymize > nAnonymizeDashAmount*COIN) nMaxToAnonymize = nAnonymizeDashAmount*COIN; + if(nMaxToAnonymize > nPrivateSendAmount*COIN) nMaxToAnonymize = nPrivateSendAmount*COIN; if(nMaxToAnonymize == 0) return; - if(nMaxToAnonymize >= nAnonymizeDashAmount * COIN) { + if(nMaxToAnonymize >= nPrivateSendAmount * COIN) { ui->labelAmountRounds->setToolTip(tr("Found enough compatible inputs to anonymize %1") - .arg(strAnonymizeDashAmount)); - strAnonymizeDashAmount = strAnonymizeDashAmount.remove(strAnonymizeDashAmount.indexOf("."), BitcoinUnits::decimals(nDisplayUnit) + 1); - strAmountAndRounds = strAnonymizeDashAmount + " / " + tr("%n Rounds", "", nPrivateSendRounds); + .arg(strPrivateSendAmount)); + strPrivateSendAmount = strPrivateSendAmount.remove(strPrivateSendAmount.indexOf("."), BitcoinUnits::decimals(nDisplayUnit) + 1); + strAmountAndRounds = strPrivateSendAmount + " / " + tr("%n Rounds", "", nPrivateSendRounds); } else { QString strMaxToAnonymize = BitcoinUnits::formatHtmlWithUnit(nDisplayUnit, nMaxToAnonymize, false, BitcoinUnits::separatorAlways); ui->labelAmountRounds->setToolTip(tr("Not enough compatible inputs to anonymize %1,
" "will anonymize %2 instead") - .arg(strAnonymizeDashAmount) + .arg(strPrivateSendAmount) .arg(strMaxToAnonymize)); strMaxToAnonymize = strMaxToAnonymize.remove(strMaxToAnonymize.indexOf("."), BitcoinUnits::decimals(nDisplayUnit) + 1); strAmountAndRounds = "" + @@ -616,7 +616,7 @@ void OverviewPage::togglePrivateSend(){ /* show darksend configuration if client has defaults set */ - if(nAnonymizeDashAmount == 0){ + if(nPrivateSendAmount == 0){ DarksendConfig dlg(this); dlg.setModel(walletModel); dlg.exec(); diff --git a/src/util.cpp b/src/util.cpp index 6673d54488e94..fee4c843d3383 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -109,7 +109,7 @@ bool fLiteMode = false; bool fEnableInstantSend = true; int nInstantSendDepth = 5; int nPrivateSendRounds = 2; -int nAnonymizeDashAmount = 1000; +int nPrivateSendAmount = 1000; int nLiquidityProvider = 0; /** nWalletBackups: diff --git a/src/util.h b/src/util.h index 1dfe7435db3ea..614681a905de0 100644 --- a/src/util.h +++ b/src/util.h @@ -37,7 +37,7 @@ extern bool fLiteMode; extern bool fEnableInstantSend; extern int nInstantSendDepth; extern int nPrivateSendRounds; -extern int nAnonymizeDashAmount; +extern int nPrivateSendAmount; extern int nLiquidityProvider; extern int nWalletBackups; extern bool fEnablePrivateSend; diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 9af3dd4c0d185..c4be319a590bd 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -1994,7 +1994,7 @@ CAmount CWallet::GetNeedsToBeAnonymizedBalance(CAmount nMinBalance) const if(fLiteMode) return 0; CAmount nAnonymizedBalance = GetAnonymizedBalance(); - CAmount nNeedsToAnonymizeBalance = nAnonymizeDashAmount*COIN - nAnonymizedBalance; + CAmount nNeedsToAnonymizeBalance = nPrivateSendAmount*COIN - nAnonymizedBalance; // try to overshoot target DS balance up to nMinBalance nNeedsToAnonymizeBalance += nMinBalance;