Skip to content

Commit 4daa4fe

Browse files
committed
GUI/Options: Configure rejecttokens using settings
1 parent f19978f commit 4daa4fe

File tree

4 files changed

+20
-0
lines changed

4 files changed

+20
-0
lines changed

src/qt/optionsdialog.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,12 @@ OptionsDialog::OptionsDialog(QWidget* parent, bool enableWallet)
267267
verticalLayout_Spamfiltering->addWidget(rejectunknownscripts);
268268
FixTabOrder(rejectunknownscripts);
269269

270+
rejecttokens = new QCheckBox(groupBox_Spamfiltering);
271+
rejecttokens->setText(tr("Ignore transactions involving non-bitcoin token/asset overlay protocols"));
272+
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."));
273+
verticalLayout_Spamfiltering->addWidget(rejecttokens);
274+
FixTabOrder(rejecttokens);
275+
270276
rejectspkreuse = new QCheckBox(groupBox_Spamfiltering);
271277
rejectspkreuse->setText(tr("Disallow most address reuse"));
272278
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()
701707
mapper->addMapping(mempoolexpiry, OptionsModel::mempoolexpiry);
702708

703709
mapper->addMapping(rejectunknownscripts, OptionsModel::rejectunknownscripts);
710+
mapper->addMapping(rejecttokens, OptionsModel::rejecttokens);
704711
mapper->addMapping(rejectspkreuse, OptionsModel::rejectspkreuse);
705712
mapper->addMapping(minrelaytxfee, OptionsModel::minrelaytxfee);
706713
mapper->addMapping(bytespersigop, OptionsModel::bytespersigop);

src/qt/optionsdialog.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ private Q_SLOTS:
109109
QSpinBox *mempoolexpiry;
110110

111111
QCheckBox *rejectunknownscripts;
112+
QCheckBox *rejecttokens;
112113
QCheckBox *rejectspkreuse;
113114
BitcoinAmountField *minrelaytxfee;
114115
QSpinBox *bytespersigop, *bytespersigopstrict;

src/qt/optionsmodel.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -660,6 +660,8 @@ QVariant OptionsModel::getOption(OptionID option, const std::string& suffix) con
660660
return qlonglong(std::chrono::duration_cast<std::chrono::hours>(node().mempool().m_opts.expiry).count());
661661
case rejectunknownscripts:
662662
return node().mempool().m_opts.require_standard;
663+
case rejecttokens:
664+
return node().mempool().m_opts.reject_tokens;
663665
case rejectspkreuse:
664666
return f_rejectspkreuse;
665667
case minrelaytxfee:
@@ -1115,6 +1117,15 @@ bool OptionsModel::setOption(OptionID option, const QVariant& value, const std::
11151117
}
11161118
break;
11171119
}
1120+
case rejecttokens:
1121+
{
1122+
if (changed()) {
1123+
const bool nv = value.toBool();
1124+
node().mempool().m_opts.reject_tokens = nv;
1125+
node().updateRwSetting("rejecttokens", nv);
1126+
}
1127+
break;
1128+
}
11181129
case rejectspkreuse:
11191130
if (changed()) {
11201131
const bool fNewValue = value.toBool();

src/qt/optionsmodel.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ class OptionsModel : public QAbstractListModel
8787
incrementalrelayfee,
8888
mempoolexpiry,
8989
rejectunknownscripts, // bool
90+
rejecttokens, // bool
9091
rejectspkreuse, // bool
9192
minrelaytxfee,
9293
bytespersigop,

0 commit comments

Comments
 (0)