diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-02-16 09:28:31 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-02-16 09:29:12 +0100 |
commit | 25d816110ba28c5014b23c9a363c472fc28a3891 (patch) | |
tree | c1e1e6f84e269b78e857c0f67ae76ca6f6b0b88f /src/qt/optionsmodel.cpp | |
parent | 085c62149ad19cecf235829e49df07884a279e1e (diff) | |
parent | 29d45073c969e20a36ee01c1beabace331cb8245 (diff) |
Merge pull request #3676
29d4507 qt: Add option to (not) spend unconfirmed change (Wladimir J. van der Laan)
Diffstat (limited to 'src/qt/optionsmodel.cpp')
-rw-r--r-- | src/qt/optionsmodel.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp index a2a2732b1c..f8354ef557 100644 --- a/src/qt/optionsmodel.cpp +++ b/src/qt/optionsmodel.cpp @@ -76,6 +76,11 @@ void OptionsModel::Init() nTransactionFee = settings.value("nTransactionFee").toLongLong(); // if -paytxfee is set, this will be overridden later in init.cpp if (mapArgs.count("-paytxfee")) strOverriddenByCommandLine += "-paytxfee "; + + if (!settings.contains("bSpendZeroConfChange")) + settings.setValue("bSpendZeroConfChange", true); + if (!SoftSetBoolArg("-spendzeroconfchange", settings.value("bSpendZeroConfChange").toBool())) + strOverriddenByCommandLine += "-spendzeroconfchange "; #endif if (!settings.contains("nDatabaseCache")) @@ -184,6 +189,8 @@ QVariant OptionsModel::data(const QModelIndex & index, int role) const // Todo: Consider to revert back to use just nTransactionFee here, if we don't want // -paytxfee to update our QSettings! return settings.value("nTransactionFee"); + case SpendZeroConfChange: + return settings.value("bSpendZeroConfChange"); #endif case DisplayUnit: return nDisplayUnit; @@ -274,6 +281,12 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in settings.setValue("nTransactionFee", (qint64)nTransactionFee); emit transactionFeeChanged(nTransactionFee); break; + case SpendZeroConfChange: + if (settings.value("bSpendZeroConfChange") != value) { + settings.setValue("bSpendZeroConfChange", value); + setRestartRequired(true); + } + break; #endif case DisplayUnit: nDisplayUnit = value.toInt(); |