diff --git a/doc/release-notes-6337.md b/doc/release-notes-6337.md
new file mode 100644
index 0000000000..e10943ee2a
--- /dev/null
+++ b/doc/release-notes-6337.md
@@ -0,0 +1,5 @@
+GUI changes
+-----------
+
+A new option has been added in to the "Main" tab in "Options" that allow
+users to enable RPC server functionality.
diff --git a/src/qt/forms/optionsdialog.ui b/src/qt/forms/optionsdialog.ui
index 8f53b2fa8c..31ce3b6e7e 100644
--- a/src/qt/forms/optionsdialog.ui
+++ b/src/qt/forms/optionsdialog.ui
@@ -112,7 +112,7 @@
Automatically start %1 after logging in to the system.
- &Start %1 on system login
+ Start %1 on system &login
@@ -291,13 +291,23 @@
40
- 20
+ 40
+ -
+
+
+ This allows you or a third party tool to communicate with the node through command-line and JSON-RPC commands.
+
+
+ Enable RPC &server
+
+
+
-
diff --git a/src/qt/optionsdialog.cpp b/src/qt/optionsdialog.cpp
index a5587373bb..3f6b485c95 100644
--- a/src/qt/optionsdialog.cpp
+++ b/src/qt/optionsdialog.cpp
@@ -267,6 +267,7 @@ void OptionsDialog::setModel(OptionsModel *_model)
connect(ui->spendZeroConfChange, &QCheckBox::clicked, this, &OptionsDialog::showRestartWarning);
/* Network */
connect(ui->allowIncoming, &QCheckBox::clicked, this, &OptionsDialog::showRestartWarning);
+ connect(ui->enableServer, &QCheckBox::clicked, this, &OptionsDialog::showRestartWarning);
connect(ui->connectSocks, &QCheckBox::clicked, this, &OptionsDialog::showRestartWarning);
connect(ui->connectSocksTor, &QCheckBox::clicked, this, &OptionsDialog::showRestartWarning);
/* Display */
@@ -343,6 +344,7 @@ void OptionsDialog::setMapper()
mapper->addMapping(ui->mapPortUpnp, OptionsModel::MapPortUPnP);
mapper->addMapping(ui->mapPortNatpmp, OptionsModel::MapPortNatpmp);
mapper->addMapping(ui->allowIncoming, OptionsModel::Listen);
+ mapper->addMapping(ui->enableServer, OptionsModel::Server);
mapper->addMapping(ui->connectSocks, OptionsModel::ProxyUse);
mapper->addMapping(ui->proxyIp, OptionsModel::ProxyIP);
diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp
index 874a255b84..c2a13d224c 100644
--- a/src/qt/optionsmodel.cpp
+++ b/src/qt/optionsmodel.cpp
@@ -275,6 +275,13 @@ void OptionsModel::Init(bool resetSettings)
gArgs.SoftSetBoolArg("-listenonion", false);
}
+ if (!settings.contains("server")) {
+ settings.setValue("server", false);
+ }
+ if (!gArgs.SoftSetBoolArg("-server", settings.value("server").toBool())) {
+ addOverriddenOption("-server");
+ }
+
if (!settings.contains("fUseProxy"))
settings.setValue("fUseProxy", false);
if (!settings.contains("addrProxy"))
@@ -529,6 +536,8 @@ QVariant OptionsModel::data(const QModelIndex & index, int role) const
return settings.value("nThreadsScriptVerif");
case Listen:
return settings.value("fListen");
+ case Server:
+ return settings.value("server");
default:
return QVariant();
}
@@ -795,6 +804,12 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in
setRestartRequired(true);
}
break;
+ case Server:
+ if (settings.value("server") != value) {
+ settings.setValue("server", value);
+ setRestartRequired(true);
+ }
+ break;
default:
break;
}
diff --git a/src/qt/optionsmodel.h b/src/qt/optionsmodel.h
index b34804ed21..dc2343d137 100644
--- a/src/qt/optionsmodel.h
+++ b/src/qt/optionsmodel.h
@@ -86,6 +86,7 @@ public:
CoinJoinDenomsHardCap,// int
CoinJoinMultiSession, // bool
Listen, // bool
+ Server, // bool
OptionIDRowCount,
};