From bbbbdd81002140f27014fec7ffa8d16fa1d4549c Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Sun, 31 Jan 2016 16:23:02 +0300 Subject: [PATCH] more darkcoin->dash Closes #690 --- doc/guide-startmany.md | 2 +- src/darksend.cpp | 2 +- src/dashd-res.rc | 4 ++-- src/init.cpp | 8 ++++---- src/qt/darksendconfig.cpp | 4 ++-- src/qt/forms/optionsdialog.ui | 2 +- src/qt/guiconstants.h | 2 +- src/qt/optionsdialog.cpp | 2 +- src/qt/optionsmodel.cpp | 27 ++++++++++++++++----------- src/qt/optionsmodel.h | 4 ++-- src/qt/overviewpage.cpp | 20 ++++++++++---------- src/util.cpp | 2 +- src/util.h | 2 +- 13 files changed, 43 insertions(+), 38 deletions(-) diff --git a/doc/guide-startmany.md b/doc/guide-startmany.md index af995c9a71..31d578e6a2 100644 --- a/doc/guide-startmany.md +++ b/doc/guide-startmany.md @@ -95,7 +95,7 @@ Issue the following: Make note of the hash (which is your collateral_output) and index. ### Enter your Masternode details into your masternode.conf file -[From the dash github repo](https://github.com/darkcoin/darkcoin/blob/master/doc/masternode_conf.md) +[From the dash github repo](https://github.com/dashpay/dash/blob/master/doc/masternode_conf.md) `masternode.conf` format is a space seperated text file. Each line consisting of an alias, IP address followed by port, masternode private key, collateral output transaction id and collateral output index. diff --git a/src/darksend.cpp b/src/darksend.cpp index 691c99812d..74221fa455 100644 --- a/src/darksend.cpp +++ b/src/darksend.cpp @@ -1409,7 +1409,7 @@ bool CDarksendPool::DoAutomaticDenominating(bool fDryRun) // should have some additional amount for them nLowestDenom += DARKSEND_COLLATERAL*4; - CAmount nBalanceNeedsAnonymized = nAnonymizeDarkcoinAmount*COIN - pwalletMain->GetAnonymizedBalance(); + CAmount nBalanceNeedsAnonymized = nAnonymizeDashAmount*COIN - pwalletMain->GetAnonymizedBalance(); // if balanceNeedsAnonymized is more than pool max, take the pool max if(nBalanceNeedsAnonymized > DARKSEND_POOL_MAX) nBalanceNeedsAnonymized = DARKSEND_POOL_MAX; diff --git a/src/dashd-res.rc b/src/dashd-res.rc index 5a21801044..f0a58e3da6 100644 --- a/src/dashd-res.rc +++ b/src/dashd-res.rc @@ -17,13 +17,13 @@ BEGIN BLOCK "040904E4" // U.S. English - multilingual (hex) BEGIN VALUE "CompanyName", "Dash" - VALUE "FileDescription", "Darkcoind (OSS daemon/client for Dash)" + VALUE "FileDescription", "Dashd (OSS daemon/client for Dash)" VALUE "FileVersion", VER_FILEVERSION_STR VALUE "InternalName", "dashd" VALUE "LegalCopyright", COPYRIGHT_STR VALUE "LegalTrademarks1", "Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php." VALUE "OriginalFilename", "dashd.exe" - VALUE "ProductName", "Darkcoind" + VALUE "ProductName", "Dashd" VALUE "ProductVersion", VER_PRODUCTVERSION_STR END END diff --git a/src/init.cpp b/src/init.cpp index 1e48f8d3ab..3bf0158312 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -422,7 +422,7 @@ std::string HelpMessage(HelpMessageMode mode) strUsage += " -enabledarksend= " + strprintf(_("Enable use of automated darksend for funds stored in this wallet (0-1, default: %u)"), fEnableDarksend) + "\n"; strUsage += " -darksendmultisession= " + strprintf(_("Enable multiple darksend mixing sessions per block, experimental (0-1, default: %u)"), fDarksendMultiSession) + "\n"; strUsage += " -darksendrounds= " + strprintf(_("Use N separate masternodes to anonymize funds (2-8, default: %u)"), nDarksendRounds) + "\n"; - strUsage += " -anonymizedashamount= " + strprintf(_("Keep N DASH anonymized (default: %u)"), nAnonymizeDarkcoinAmount) + "\n"; + strUsage += " -anonymizedashamount= " + strprintf(_("Keep N DASH anonymized (default: %u)"), nAnonymizeDashAmount) + "\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)"), nLiquidityProvider) + "\n"; strUsage += "\n" + _("InstantX options:") + "\n"; @@ -1545,8 +1545,8 @@ bool AppInit2(boost::thread_group& threadGroup) fDarksendMultiSession = GetBoolArg("-darksendmultisession", fDarksendMultiSession); nDarksendRounds = GetArg("-darksendrounds", nDarksendRounds); nDarksendRounds = std::min(std::max(nDarksendRounds, 1), 99999); - nAnonymizeDarkcoinAmount = GetArg("-anonymizedashamount", nAnonymizeDarkcoinAmount); - nAnonymizeDarkcoinAmount = std::min(std::max(nAnonymizeDarkcoinAmount, 2), 999999); + nAnonymizeDashAmount = GetArg("-anonymizedashamount", nAnonymizeDashAmount); + nAnonymizeDashAmount = std::min(std::max(nAnonymizeDashAmount, 2), 999999); fEnableInstantX = GetBoolArg("-enableinstantx", fEnableInstantX); nInstantXDepth = GetArg("-instantxdepth", nInstantXDepth); @@ -1561,7 +1561,7 @@ bool AppInit2(boost::thread_group& threadGroup) LogPrintf("fLiteMode %d\n", fLiteMode); LogPrintf("nInstantXDepth %d\n", nInstantXDepth); LogPrintf("Darksend rounds %d\n", nDarksendRounds); - LogPrintf("Anonymize Dash Amount %d\n", nAnonymizeDarkcoinAmount); + LogPrintf("Anonymize Dash Amount %d\n", nAnonymizeDashAmount); LogPrintf("Budget Mode %s\n", strBudgetMode.c_str()); darkSendPool.InitDenominations(); diff --git a/src/qt/darksendconfig.cpp b/src/qt/darksendconfig.cpp index 5929efa139..b117791e2d 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("nDarksendRounds", rounds); - settings.setValue("nAnonymizeDarkcoinAmount", coins); + settings.setValue("nAnonymizeDashAmount", coins); nDarksendRounds = rounds; - nAnonymizeDarkcoinAmount = coins; + nAnonymizeDashAmount = coins; } diff --git a/src/qt/forms/optionsdialog.ui b/src/qt/forms/optionsdialog.ui index 27e8773fca..c1651c586a 100644 --- a/src/qt/forms/optionsdialog.ui +++ b/src/qt/forms/optionsdialog.ui @@ -182,7 +182,7 @@ - + 2 diff --git a/src/qt/guiconstants.h b/src/qt/guiconstants.h index 47974d89c1..349d2083d8 100644 --- a/src/qt/guiconstants.h +++ b/src/qt/guiconstants.h @@ -12,7 +12,7 @@ static const int MODEL_UPDATE_DELAY = 250; /* AskPassphraseDialog -- Maximum passphrase length */ static const int MAX_PASSPHRASE_SIZE = 1024; -/* DarkcoinGUI -- Size of icons in status bar */ +/* DashGUI -- Size of icons in status bar */ static const int STATUSBAR_ICONSIZE = 16; /* Invalid field background style */ diff --git a/src/qt/optionsdialog.cpp b/src/qt/optionsdialog.cpp index 8751ebb462..7830f91cce 100644 --- a/src/qt/optionsdialog.cpp +++ b/src/qt/optionsdialog.cpp @@ -210,7 +210,7 @@ void OptionsDialog::setMapper() /* Darksend Rounds */ mapper->addMapping(ui->darksendRounds, OptionsModel::DarksendRounds); - mapper->addMapping(ui->anonymizeDarkcoin, OptionsModel::AnonymizeDarkcoinAmount); + mapper->addMapping(ui->anonymizeDash, OptionsModel::AnonymizeDashAmount); } diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp index e2f15ae740..1574dae1a6 100644 --- a/src/qt/optionsmodel.cpp +++ b/src/qt/optionsmodel.cpp @@ -74,11 +74,16 @@ void OptionsModel::Init() if (!settings.contains("nDarksendRounds")) settings.setValue("nDarksendRounds", 2); - if (!settings.contains("nAnonymizeDarkcoinAmount")) - settings.setValue("nAnonymizeDarkcoinAmount", 1000); + if (!settings.contains("nAnonymizeDashAmount")) { + // for migration from old settings + if (!settings.contains("nAnonymizeDarkcoinAmount")) + settings.setValue("nAnonymizeDashAmount", 1000); + else + settings.setValue("nAnonymizeDashAmount", settings.value("nAnonymizeDarkcoinAmount")); + } nDarksendRounds = settings.value("nDarksendRounds").toLongLong(); - nAnonymizeDarkcoinAmount = settings.value("nAnonymizeDarkcoinAmount").toLongLong(); + nAnonymizeDashAmount = settings.value("nAnonymizeDashAmount").toLongLong(); // These are shared with the core or have a command-line parameter // and we want command-line parameters to overwrite the GUI settings. @@ -140,8 +145,8 @@ void OptionsModel::Init() if (settings.contains("nDarksendRounds")) SoftSetArg("-darksendrounds", settings.value("nDarksendRounds").toString().toStdString()); - if (settings.contains("nAnonymizeDarkcoinAmount")) - SoftSetArg("-anonymizedashamount", settings.value("nAnonymizeDarkcoinAmount").toString().toStdString()); + if (settings.contains("nAnonymizeDashAmount")) + SoftSetArg("-anonymizedashamount", settings.value("nAnonymizeDashAmount").toString().toStdString()); language = settings.value("language").toString(); } @@ -221,8 +226,8 @@ QVariant OptionsModel::data(const QModelIndex & index, int role) const return settings.value("nThreadsScriptVerif"); case DarksendRounds: return QVariant(nDarksendRounds); - case AnonymizeDarkcoinAmount: - return QVariant(nAnonymizeDarkcoinAmount); + case AnonymizeDashAmount: + return QVariant(nAnonymizeDashAmount); case Listen: return settings.value("fListen"); default: @@ -329,10 +334,10 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in settings.setValue("nDarksendRounds", nDarksendRounds); emit darksendRoundsChanged(nDarksendRounds); break; - case AnonymizeDarkcoinAmount: - nAnonymizeDarkcoinAmount = value.toInt(); - settings.setValue("nAnonymizeDarkcoinAmount", nAnonymizeDarkcoinAmount); - emit anonymizeDarkcoinAmountChanged(nAnonymizeDarkcoinAmount); + case AnonymizeDashAmount: + nAnonymizeDashAmount = value.toInt(); + settings.setValue("nAnonymizeDashAmount", nAnonymizeDashAmount); + emit anonymizeDashAmountChanged(nAnonymizeDashAmount); break; case CoinControlFeatures: fCoinControlFeatures = value.toBool(); diff --git a/src/qt/optionsmodel.h b/src/qt/optionsmodel.h index 4bd7d698c2..01226f001c 100644 --- a/src/qt/optionsmodel.h +++ b/src/qt/optionsmodel.h @@ -44,7 +44,7 @@ public: DatabaseCache, // int SpendZeroConfChange, // bool DarksendRounds, // int - AnonymizeDarkcoinAmount, //int + AnonymizeDashAmount, //int Listen, // bool OptionIDRowCount, }; @@ -89,7 +89,7 @@ private: signals: void displayUnitChanged(int unit); void darksendRoundsChanged(int); - void anonymizeDarkcoinAmountChanged(int); + void anonymizeDashAmountChanged(int); void coinControlFeaturesChanged(bool); }; diff --git a/src/qt/overviewpage.cpp b/src/qt/overviewpage.cpp index d5d5153bed..238a11a414 100644 --- a/src/qt/overviewpage.cpp +++ b/src/qt/overviewpage.cpp @@ -320,7 +320,7 @@ void OverviewPage::updateDarksendProgress() if(!pwalletMain) return; QString strAmountAndRounds; - QString strAnonymizeDarkcoinAmount = BitcoinUnits::formatHtmlWithUnit(nDisplayUnit, nAnonymizeDarkcoinAmount * COIN, false, BitcoinUnits::separatorAlways); + QString strAnonymizeDashAmount = BitcoinUnits::formatHtmlWithUnit(nDisplayUnit, nAnonymizeDashAmount * COIN, false, BitcoinUnits::separatorAlways); if(currentBalance == 0) { @@ -328,8 +328,8 @@ void OverviewPage::updateDarksendProgress() ui->darksendProgress->setToolTip(tr("No inputs detected")); // when balance is zero just show info from settings - strAnonymizeDarkcoinAmount = strAnonymizeDarkcoinAmount.remove(strAnonymizeDarkcoinAmount.indexOf("."), BitcoinUnits::decimals(nDisplayUnit) + 1); - strAmountAndRounds = strAnonymizeDarkcoinAmount + " / " + tr("%n Rounds", "", nDarksendRounds); + strAnonymizeDashAmount = strAnonymizeDashAmount.remove(strAnonymizeDashAmount.indexOf("."), BitcoinUnits::decimals(nDisplayUnit) + 1); + strAmountAndRounds = strAnonymizeDashAmount + " / " + tr("%n Rounds", "", nDarksendRounds); ui->labelAmountRounds->setToolTip(tr("No inputs detected")); ui->labelAmountRounds->setText(strAmountAndRounds); @@ -356,20 +356,20 @@ void OverviewPage::updateDarksendProgress() CAmount nMaxToAnonymize = nAnonymizableBalance + currentAnonymizedBalance + nDenominatedUnconfirmedBalance; // If it's more than the anon threshold, limit to that. - if(nMaxToAnonymize > nAnonymizeDarkcoinAmount*COIN) nMaxToAnonymize = nAnonymizeDarkcoinAmount*COIN; + if(nMaxToAnonymize > nAnonymizeDashAmount*COIN) nMaxToAnonymize = nAnonymizeDashAmount*COIN; if(nMaxToAnonymize == 0) return; - if(nMaxToAnonymize >= nAnonymizeDarkcoinAmount * COIN) { + if(nMaxToAnonymize >= nAnonymizeDashAmount * COIN) { ui->labelAmountRounds->setToolTip(tr("Found enough compatible inputs to anonymize %1") - .arg(strAnonymizeDarkcoinAmount)); - strAnonymizeDarkcoinAmount = strAnonymizeDarkcoinAmount.remove(strAnonymizeDarkcoinAmount.indexOf("."), BitcoinUnits::decimals(nDisplayUnit) + 1); - strAmountAndRounds = strAnonymizeDarkcoinAmount + " / " + tr("%n Rounds", "", nDarksendRounds); + .arg(strAnonymizeDashAmount)); + strAnonymizeDashAmount = strAnonymizeDashAmount.remove(strAnonymizeDashAmount.indexOf("."), BitcoinUnits::decimals(nDisplayUnit) + 1); + strAmountAndRounds = strAnonymizeDashAmount + " / " + tr("%n Rounds", "", nDarksendRounds); } 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(strAnonymizeDarkcoinAmount) + .arg(strAnonymizeDashAmount) .arg(strMaxToAnonymize)); strMaxToAnonymize = strMaxToAnonymize.remove(strMaxToAnonymize.indexOf("."), BitcoinUnits::decimals(nDisplayUnit) + 1); strAmountAndRounds = "" + @@ -540,7 +540,7 @@ void OverviewPage::toggleDarksend(){ /* show darksend configuration if client has defaults set */ - if(nAnonymizeDarkcoinAmount == 0){ + if(nAnonymizeDashAmount == 0){ DarksendConfig dlg(this); dlg.setModel(walletModel); dlg.exec(); diff --git a/src/util.cpp b/src/util.cpp index b0ab03c284..d8c4334469 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -111,7 +111,7 @@ bool fLiteMode = false; bool fEnableInstantX = true; int nInstantXDepth = 5; int nDarksendRounds = 2; -int nAnonymizeDarkcoinAmount = 1000; +int nAnonymizeDashAmount = 1000; int nLiquidityProvider = 0; /** Spork enforcement enabled time */ int64_t enforceMasternodePaymentsTime = 4085657524; diff --git a/src/util.h b/src/util.h index 069b31a6db..7a9fb7cbf1 100644 --- a/src/util.h +++ b/src/util.h @@ -36,7 +36,7 @@ extern bool fLiteMode; extern bool fEnableInstantX; extern int nInstantXDepth; extern int nDarksendRounds; -extern int nAnonymizeDarkcoinAmount; +extern int nAnonymizeDashAmount; extern int nLiquidityProvider; extern bool fEnableDarksend; extern bool fDarksendMultiSession;