mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-05-12 19:20:42 +02:00
Qt/Options: Configure incrementalrelayfee using rwconf
This commit is contained in:
parent
e8f3dbeb28
commit
1fa7351883
@ -49,7 +49,12 @@
|
||||
|
||||
void OptionsDialog::FixTabOrder(QWidget * const o)
|
||||
{
|
||||
setTabOrder(prevwidget, o);
|
||||
BitcoinAmountField * const af = qobject_cast<BitcoinAmountField *>(o);
|
||||
if (af) {
|
||||
af->setupTabChain(prevwidget);
|
||||
} else {
|
||||
setTabOrder(prevwidget, o);
|
||||
}
|
||||
prevwidget = o;
|
||||
}
|
||||
|
||||
@ -236,6 +241,10 @@ OptionsDialog::OptionsDialog(QWidget* parent, bool enableWallet)
|
||||
maxmempool->setMaximum(std::numeric_limits<int>::max());
|
||||
CreateOptionUI(verticalLayout_Mempool, maxmempool, tr("Keep the transaction memory pool below %s MB"));
|
||||
|
||||
incrementalrelayfee = new BitcoinAmountField(tabMempool);
|
||||
connect(incrementalrelayfee, SIGNAL(valueChanged()), this, SLOT(incrementalrelayfee_changed()));
|
||||
CreateOptionUI(verticalLayout_Mempool, incrementalrelayfee, tr("Require transaction fees to be at least %s per kvB higher than transactions they are replacing."));
|
||||
|
||||
mempoolexpiry = new QSpinBox(tabMempool);
|
||||
mempoolexpiry->setMinimum(1);
|
||||
mempoolexpiry->setMaximum(std::numeric_limits<int>::max());
|
||||
@ -575,6 +584,7 @@ void OptionsDialog::setMapper()
|
||||
|
||||
mapper->addMapping(maxorphantx, OptionsModel::maxorphantx);
|
||||
mapper->addMapping(maxmempool, OptionsModel::maxmempool);
|
||||
mapper->addMapping(incrementalrelayfee, OptionsModel::incrementalrelayfee);
|
||||
mapper->addMapping(mempoolexpiry, OptionsModel::mempoolexpiry);
|
||||
|
||||
mapper->addMapping(rejectunknownscripts, OptionsModel::rejectunknownscripts);
|
||||
@ -626,6 +636,13 @@ void OptionsDialog::setOkButtonState(bool fState)
|
||||
ui->okButton->setEnabled(fState);
|
||||
}
|
||||
|
||||
void OptionsDialog::incrementalrelayfee_changed()
|
||||
{
|
||||
if (incrementalrelayfee->value() > minrelaytxfee->value()) {
|
||||
minrelaytxfee->setValue(incrementalrelayfee->value());
|
||||
}
|
||||
}
|
||||
|
||||
void OptionsDialog::blockmaxsize_changed(int i)
|
||||
{
|
||||
if (blockprioritysize->value() > i) {
|
||||
|
@ -76,6 +76,7 @@ private Q_SLOTS:
|
||||
void updateDefaultProxyNets();
|
||||
void checkLineEdit();
|
||||
|
||||
void incrementalrelayfee_changed();
|
||||
void blockmaxsize_changed(int);
|
||||
void blockmaxsize_increase(int);
|
||||
void blockmaxweight_changed(int);
|
||||
@ -100,6 +101,7 @@ private:
|
||||
|
||||
QValueComboBox *mempoolreplacement;
|
||||
QSpinBox *maxorphantx;
|
||||
BitcoinAmountField *incrementalrelayfee;
|
||||
QSpinBox *maxmempool;
|
||||
QSpinBox *mempoolexpiry;
|
||||
|
||||
|
@ -647,6 +647,8 @@ QVariant OptionsModel::getOption(OptionID option, const std::string& suffix) con
|
||||
return qlonglong(gArgs.GetIntArg("-maxorphantx", DEFAULT_MAX_ORPHAN_TRANSACTIONS));
|
||||
case maxmempool:
|
||||
return qlonglong(node().mempool().m_opts.max_size_bytes / 1'000'000);
|
||||
case incrementalrelayfee:
|
||||
return qlonglong(node().mempool().m_opts.incremental_relay_feerate.GetFeePerK());
|
||||
case mempoolexpiry:
|
||||
return qlonglong(std::chrono::duration_cast<std::chrono::hours>(node().mempool().m_opts.expiry).count());
|
||||
case rejectunknownscripts:
|
||||
@ -1047,6 +1049,13 @@ bool OptionsModel::setOption(OptionID option, const QVariant& value, const std::
|
||||
}
|
||||
break;
|
||||
}
|
||||
case incrementalrelayfee:
|
||||
if (changed()) {
|
||||
CAmount nNv = value.toLongLong();
|
||||
gArgs.ModifyRWConfigFile("incrementalrelayfee", FormatMoney(nNv));
|
||||
node().mempool().m_opts.incremental_relay_feerate = CFeeRate(nNv);
|
||||
}
|
||||
break;
|
||||
case mempoolexpiry:
|
||||
{
|
||||
if (changed()) {
|
||||
|
@ -84,6 +84,7 @@ public:
|
||||
mempoolreplacement,
|
||||
maxorphantx,
|
||||
maxmempool,
|
||||
incrementalrelayfee,
|
||||
mempoolexpiry,
|
||||
rejectunknownscripts, // bool
|
||||
minrelaytxfee,
|
||||
|
Loading…
Reference in New Issue
Block a user