From 039023d9c996222e1c42ad353224c2f4b626f64c Mon Sep 17 00:00:00 2001 From: Evan Duffield Date: Thu, 25 Dec 2014 11:20:18 -0700 Subject: [PATCH] fixed Darksend settings --- src/qt/forms/optionsdialog.ui | 45 +++++++++++++++++++++++++++++++++++ src/qt/optionsdialog.cpp | 8 +++++++ src/qt/optionsmodel.cpp | 9 +++++++ src/qt/optionsmodel.h | 2 +- src/version.cpp | 2 +- 5 files changed, 64 insertions(+), 2 deletions(-) diff --git a/src/qt/forms/optionsdialog.ui b/src/qt/forms/optionsdialog.ui index dc4e78b9e7..7477bed0e1 100644 --- a/src/qt/forms/optionsdialog.ui +++ b/src/qt/forms/optionsdialog.ui @@ -158,7 +158,52 @@ + + + + + + <html><head/><body><p>This amount acts as a threshold to turn off Darksend once it's reached. </p></body></html> + + + + + + + + + + + + + + + Amount of Darkcoin to keep anonymized + + + + + + + 1 + + + 2000 + + + 10 + + + 1000 + + + + + + + + diff --git a/src/qt/optionsdialog.cpp b/src/qt/optionsdialog.cpp index 96464d2cc0..46e60c372d 100644 --- a/src/qt/optionsdialog.cpp +++ b/src/qt/optionsdialog.cpp @@ -13,6 +13,7 @@ #include "guiutil.h" #include "monitoreddatamapper.h" #include "optionsmodel.h" +#include "darksend.h" #include "main.h" // for CTransaction::nMinTxFee and MAX_SCRIPTCHECK_THREADS #include "netbase.h" @@ -188,6 +189,12 @@ void OptionsDialog::setMapper() mapper->addMapping(ui->unit, OptionsModel::DisplayUnit); mapper->addMapping(ui->displayAddresses, OptionsModel::DisplayAddresses); mapper->addMapping(ui->thirdPartyTxUrls, OptionsModel::ThirdPartyTxUrls); + + + /* Darksend Rounds */ + mapper->addMapping(ui->darksendRounds, OptionsModel::DarksendRounds); + mapper->addMapping(ui->anonymizeDarkcoin, OptionsModel::AnonymizeDarkcoinAmount); + } void OptionsDialog::enableOkButton() @@ -228,6 +235,7 @@ void OptionsDialog::on_resetButton_clicked() void OptionsDialog::on_okButton_clicked() { mapper->submit(); + darkSendPool.cachedNumBlocks = 0; accept(); } diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp index 38ed9add55..6c9619f3c8 100644 --- a/src/qt/optionsmodel.cpp +++ b/src/qt/optionsmodel.cpp @@ -72,6 +72,15 @@ void OptionsModel::Init() settings.setValue("fCoinControlFeatures", false); fCoinControlFeatures = settings.value("fCoinControlFeatures", false).toBool(); + if (!settings.contains("nDarksendRounds")) + settings.setValue("nDarksendRounds", 2); + + if (!settings.contains("nAnonymizeDarkcoinAmount")) + settings.setValue("nAnonymizeDarkcoinAmount", 1000); + + nDarksendRounds = settings.value("nDarksendRounds").toLongLong(); + nAnonymizeDarkcoinAmount = settings.value("nAnonymizeDarkcoinAmount").toLongLong(); + // These are shared with the core or have a command-line parameter // and we want command-line parameters to overwrite the GUI settings. // diff --git a/src/qt/optionsmodel.h b/src/qt/optionsmodel.h index 37f1d0b7c0..9d239f2df4 100644 --- a/src/qt/optionsmodel.h +++ b/src/qt/optionsmodel.h @@ -42,9 +42,9 @@ public: ThreadsScriptVerif, // int DatabaseCache, // int SpendZeroConfChange, // bool - OptionIDRowCount, DarksendRounds, // int AnonymizeDarkcoinAmount, //int + OptionIDRowCount, }; void Init(); diff --git a/src/version.cpp b/src/version.cpp index f716a57b45..371df3614e 100644 --- a/src/version.cpp +++ b/src/version.cpp @@ -10,7 +10,7 @@ // Name of client reported in the 'version' message. Report the same name // for both darkcoind and darkcoin-qt, to make it harder for attackers to // target servers or GUI users specifically. -const std::string CLIENT_NAME("Duffield"); +const std::string CLIENT_NAME("Darkcoin Core"); // Client version number #define CLIENT_VERSION_SUFFIX "-beta"