diff --git a/src/qt/optionsdialog.cpp b/src/qt/optionsdialog.cpp index e67519513a..acf2f0c0d7 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); + 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.")); + verticalLayout_Spamfiltering->addWidget(rejecttokens); + FixTabOrder(rejecttokens); + rejectspkreuse = new QCheckBox(groupBox_Spamfiltering); rejectspkreuse->setText(tr("Disallow most address reuse")); rejectspkreuse->setToolTip(tr("With this option enabled, your memory pool will only allow each unique payment destination to be used once, effectively deprioritising address reuse. Address reuse is not technically supported, and harms the privacy of all Bitcoin users. It also has limited real-world utility, and has been known to be common with spam.")); @@ -701,6 +707,7 @@ void OptionsDialog::setMapper() mapper->addMapping(mempoolexpiry, OptionsModel::mempoolexpiry); mapper->addMapping(rejectunknownscripts, OptionsModel::rejectunknownscripts); + mapper->addMapping(rejecttokens, OptionsModel::rejecttokens); mapper->addMapping(rejectspkreuse, OptionsModel::rejectspkreuse); mapper->addMapping(minrelaytxfee, OptionsModel::minrelaytxfee); mapper->addMapping(bytespersigop, OptionsModel::bytespersigop); diff --git a/src/qt/optionsdialog.h b/src/qt/optionsdialog.h index 97bd22c1b7..e51bc57744 100644 --- a/src/qt/optionsdialog.h +++ b/src/qt/optionsdialog.h @@ -109,6 +109,7 @@ private: QSpinBox *mempoolexpiry; QCheckBox *rejectunknownscripts; + QCheckBox *rejecttokens; QCheckBox *rejectspkreuse; BitcoinAmountField *minrelaytxfee; QSpinBox *bytespersigop, *bytespersigopstrict; diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp index eca6206a97..9dc60d65d5 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 rejecttokens: + return node().mempool().m_opts.reject_tokens; case rejectspkreuse: return f_rejectspkreuse; case minrelaytxfee: @@ -1115,6 +1117,15 @@ bool OptionsModel::setOption(OptionID option, const QVariant& value, const std:: } break; } + case rejecttokens: + { + if (changed()) { + const bool nv = value.toBool(); + node().mempool().m_opts.reject_tokens = nv; + node().updateRwSetting("rejecttokens", nv); + } + break; + } case rejectspkreuse: if (changed()) { const bool fNewValue = value.toBool(); diff --git a/src/qt/optionsmodel.h b/src/qt/optionsmodel.h index ea0e7d5fe0..0c61962a90 100644 --- a/src/qt/optionsmodel.h +++ b/src/qt/optionsmodel.h @@ -87,6 +87,7 @@ public: incrementalrelayfee, mempoolexpiry, rejectunknownscripts, // bool + rejecttokens, // bool rejectspkreuse, // bool minrelaytxfee, bytespersigop,