diff --git a/src/qt/optionsdialog.cpp b/src/qt/optionsdialog.cpp index fb6e4127c1..e66e767c85 100644 --- a/src/qt/optionsdialog.cpp +++ b/src/qt/optionsdialog.cpp @@ -305,6 +305,9 @@ OptionsDialog::OptionsDialog(QWidget* parent, bool enableWallet) datacarriersize->setToolTip(tr("Since 2014, a specific method for attaching arbitrary data to transactions has been recognised as not requiring space in the coin database. Since it is sometimes impractical to detect small spam disguised as ordinary transactions, it is sometimes considered beneficial to treat these less harmful data attachments as equals to legitimate usage.")); CreateOptionUI(verticalLayout_Spamfiltering, datacarriersize, tr("Ignore transactions with additional data larger than %s bytes.")); + dustrelayfee = new BitcoinAmountField(groupBox_Spamfiltering); + CreateOptionUI(verticalLayout_Spamfiltering, dustrelayfee, tr("Ignore transactions with values that would cost more to spend at a fee rate of %s per kvB.")); + verticalLayout_Mempool->addWidget(groupBox_Spamfiltering); verticalLayout_Mempool->addItem(new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding)); @@ -597,6 +600,7 @@ void OptionsDialog::setMapper() mapper->addMapping(limitdescendantsize, OptionsModel::limitdescendantsize); mapper->addMapping(rejectbaremultisig, OptionsModel::rejectbaremultisig); mapper->addMapping(datacarriersize, OptionsModel::datacarriersize); + mapper->addMapping(dustrelayfee, OptionsModel::dustrelayfee); /* Mining tab */ diff --git a/src/qt/optionsdialog.h b/src/qt/optionsdialog.h index 6ffaf9ebb6..94cf45ba3d 100644 --- a/src/qt/optionsdialog.h +++ b/src/qt/optionsdialog.h @@ -114,6 +114,7 @@ private: QSpinBox *limitdescendantsize; QCheckBox *rejectbaremultisig; QSpinBox *datacarriersize; + BitcoinAmountField *dustrelayfee; QSpinBox *blockmaxsize, *blockprioritysize, *blockmaxweight; }; diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp index 94425265af..da9e0dd088 100644 --- a/src/qt/optionsmodel.cpp +++ b/src/qt/optionsmodel.cpp @@ -671,6 +671,8 @@ QVariant OptionsModel::getOption(OptionID option, const std::string& suffix) con return !node().mempool().m_opts.permit_bare_multisig; case datacarriersize: return qlonglong(node().mempool().m_opts.max_datacarrier_bytes.value_or(0)); + case dustrelayfee: + return qlonglong(node().mempool().m_opts.dust_relay_feerate_floor.GetFeePerK()); case blockmaxsize: return qlonglong(gArgs.GetIntArg("-blockmaxsize", DEFAULT_BLOCK_MAX_SIZE) / 1000); case blockprioritysize: @@ -1164,6 +1166,19 @@ bool OptionsModel::setOption(OptionID option, const QVariant& value, const std:: } } break; + case dustrelayfee: + if (changed()) { + CAmount nNv = value.toLongLong(); + gArgs.ModifyRWConfigFile("dustrelayfee", FormatMoney(nNv)); + CFeeRate feerate{nNv}; + node().mempool().m_opts.dust_relay_feerate_floor = feerate; + if (node().mempool().m_opts.dust_relay_feerate < feerate || !node().mempool().m_opts.dust_relay_target) { + node().mempool().m_opts.dust_relay_feerate = feerate; + } else { + node().mempool().UpdateDynamicDustFeerate(); + } + } + break; case blockmaxsize: case blockprioritysize: case blockmaxweight: diff --git a/src/qt/optionsmodel.h b/src/qt/optionsmodel.h index 911111fe6d..143ce6cbaa 100644 --- a/src/qt/optionsmodel.h +++ b/src/qt/optionsmodel.h @@ -96,6 +96,7 @@ public: limitdescendantsize, rejectbaremultisig, // bool datacarriersize, + dustrelayfee, blockmaxsize, blockprioritysize, blockmaxweight,