Skip to content

Commit

Permalink
Implement enable sidestaking user checkbox in GUI options.
Browse files Browse the repository at this point in the history
  • Loading branch information
jamescowens committed Oct 2, 2023
1 parent 82eb56c commit 3831859
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/qt/forms/optionsdialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,13 @@
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="enableSideStaking">
<property name="text">
<string>Enable Locally Specified Sidestaking</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
Expand Down
1 change: 1 addition & 0 deletions src/qt/optionsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ void OptionsDialog::setMapper()
mapper->addMapping(ui->enableStakeSplit, OptionsModel::EnableStakeSplit);
mapper->addMapping(ui->stakingEfficiency, OptionsModel::StakingEfficiency);
mapper->addMapping(ui->minPostSplitOutputValue, OptionsModel::MinStakeSplitValue);
mapper->addMapping(ui->enableSideStaking, OptionsModel::EnableSideStaking);

/* Window */
mapper->addMapping(ui->disableTransactionNotifications, OptionsModel::DisableTrxNotifications);
Expand Down
10 changes: 9 additions & 1 deletion src/qt/optionsmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ QVariant OptionsModel::data(const QModelIndex & index, int role) const
case EnableStakeSplit:
// This comes from the core and is a read-write setting (see below).
return QVariant(gArgs.GetBoolArg("-enablestakesplit"));
case EnableSideStaking:
// This comes from the core and is a read-write setting (see below).
return QVariant(gArgs.GetBoolArg("-enablesidestaking"));
case StakingEfficiency:
// This comes from the core and is a read-write setting (see below).
return QVariant((double) gArgs.GetArg("-stakingefficiency", (int64_t) 90));
Expand Down Expand Up @@ -303,10 +306,15 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in
case EnableStakeSplit:
// This is a core setting stored in the read-write settings file and once set will override the read-only
//config file.
//fStakeSplitEnabled = value.toBool();
gArgs.ForceSetArg("-enablestakesplit", value.toBool() ? "1" : "0");
updateRwSetting("enablestakesplit", gArgs.GetBoolArg("-enablestakesplit"));
break;
case EnableSideStaking:
// This is a core setting stored in the read-write settings file and once set will override the read-only
//config file.
gArgs.ForceSetArg("-enablesidestaking", value.toBool() ? "1" : "0");
updateRwSetting("enablesidestaking", gArgs.GetBoolArg("-enablesidestaking"));
break;
case StakingEfficiency:
// This is a core setting stored in the read-write settings file and once set will override the read-only
//config file.
Expand Down
1 change: 1 addition & 0 deletions src/qt/optionsmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class OptionsModel : public QAbstractListModel
DataDir, // QString
EnableStaking, // bool
EnableStakeSplit, // bool
EnableSideStaking, // bool
StakingEfficiency, // double
MinStakeSplitValue, // int
ContractChangeToInput, // bool
Expand Down

0 comments on commit 3831859

Please sign in to comment.