diff --git a/src/qt/optionsdialog.cpp b/src/qt/optionsdialog.cpp index acf2f0c0d7..ebb1d67e06 100644 --- a/src/qt/optionsdialog.cpp +++ b/src/qt/optionsdialog.cpp @@ -267,6 +267,12 @@ OptionsDialog::OptionsDialog(QWidget* parent, bool enableWallet) verticalLayout_Spamfiltering->addWidget(rejectunknownscripts); FixTabOrder(rejectunknownscripts); + rejectparasites = new QCheckBox(groupBox_Spamfiltering); + rejectparasites->setText(tr("Reject parasite transactions")); + rejectparasites->setToolTip(tr("With this option enabled, transactions related to parasitic overlay protocols will be ignored. Parasites are transactions using Bitcoin as a technical infrastructure to animate other protocols, unrelated to ordinary money transfers.")); + verticalLayout_Spamfiltering->addWidget(rejectparasites); + FixTabOrder(rejectparasites); + rejecttokens = new QCheckBox(groupBox_Spamfiltering); rejecttokens->setText(tr("Ignore transactions involving non-bitcoin token/asset overlay protocols")); rejecttokens->setToolTip(tr("With this option enabled, transactions involving non-bitcoin tokens/assets will not be relayed or mined by your node. Due to not having value, and some technical design flaws, token mints and transfers are often spammy and can bog down the network.")); @@ -707,6 +713,7 @@ void OptionsDialog::setMapper() mapper->addMapping(mempoolexpiry, OptionsModel::mempoolexpiry); mapper->addMapping(rejectunknownscripts, OptionsModel::rejectunknownscripts); + mapper->addMapping(rejectparasites, OptionsModel::rejectparasites); mapper->addMapping(rejecttokens, OptionsModel::rejecttokens); mapper->addMapping(rejectspkreuse, OptionsModel::rejectspkreuse); mapper->addMapping(minrelaytxfee, OptionsModel::minrelaytxfee); diff --git a/src/qt/optionsdialog.h b/src/qt/optionsdialog.h index e51bc57744..550e1f7a7d 100644 --- a/src/qt/optionsdialog.h +++ b/src/qt/optionsdialog.h @@ -109,6 +109,7 @@ private: QSpinBox *mempoolexpiry; QCheckBox *rejectunknownscripts; + QCheckBox *rejectparasites; QCheckBox *rejecttokens; QCheckBox *rejectspkreuse; BitcoinAmountField *minrelaytxfee; diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp index 9dc60d65d5..e8013c08a2 100644 --- a/src/qt/optionsmodel.cpp +++ b/src/qt/optionsmodel.cpp @@ -660,6 +660,8 @@ QVariant OptionsModel::getOption(OptionID option, const std::string& suffix) con return qlonglong(std::chrono::duration_cast(node().mempool().m_opts.expiry).count()); case rejectunknownscripts: return node().mempool().m_opts.require_standard; + case rejectparasites: + return node().mempool().m_opts.reject_parasites; case rejecttokens: return node().mempool().m_opts.reject_tokens; case rejectspkreuse: @@ -1117,6 +1119,15 @@ bool OptionsModel::setOption(OptionID option, const QVariant& value, const std:: } break; } + case rejectparasites: + { + if (changed()) { + const bool nv = value.toBool(); + node().mempool().m_opts.reject_parasites = nv; + node().updateRwSetting("rejectparasites", nv); + } + break; + } case rejecttokens: { if (changed()) { diff --git a/src/qt/optionsmodel.h b/src/qt/optionsmodel.h index 0c61962a90..7b502f1b14 100644 --- a/src/qt/optionsmodel.h +++ b/src/qt/optionsmodel.h @@ -87,6 +87,7 @@ public: incrementalrelayfee, mempoolexpiry, rejectunknownscripts, // bool + rejectparasites, // bool rejecttokens, // bool rejectspkreuse, // bool minrelaytxfee,