mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-06-04 00:12:33 +02:00
Qt/Options: Configure bytespersigopstrict using rwconf
This commit is contained in:
parent
d7336e8555
commit
72ce0246fd
@ -228,6 +228,16 @@ OptionsDialog::OptionsDialog(QWidget* parent, bool enableWallet)
|
||||
verticalLayout_Spamfiltering->addWidget(rejectunknownscripts);
|
||||
FixTabOrder(rejectunknownscripts);
|
||||
|
||||
bytespersigop = new QSpinBox(groupBox_Spamfiltering);
|
||||
bytespersigop->setMinimum(1);
|
||||
bytespersigop->setMaximum(std::numeric_limits<int>::max());
|
||||
CreateOptionUI(verticalLayout_Spamfiltering, bytespersigop, tr("Treat each consensus-counted sigop as at least %s bytes."));
|
||||
|
||||
bytespersigopstrict = new QSpinBox(groupBox_Spamfiltering);
|
||||
bytespersigopstrict->setMinimum(1);
|
||||
bytespersigopstrict->setMaximum(std::numeric_limits<int>::max());
|
||||
CreateOptionUI(verticalLayout_Spamfiltering, bytespersigopstrict, tr("Ignore transactions with fewer than %s bytes per potentially-executed sigop."));
|
||||
|
||||
verticalLayout_Mempool->addWidget(groupBox_Spamfiltering);
|
||||
|
||||
verticalLayout_Mempool->addItem(new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding));
|
||||
@ -472,6 +482,8 @@ void OptionsDialog::setMapper()
|
||||
mapper->addMapping(mempoolexpiry, OptionsModel::mempoolexpiry);
|
||||
|
||||
mapper->addMapping(rejectunknownscripts, OptionsModel::rejectunknownscripts);
|
||||
mapper->addMapping(bytespersigop, OptionsModel::bytespersigop);
|
||||
mapper->addMapping(bytespersigopstrict, OptionsModel::bytespersigopstrict);
|
||||
|
||||
/* Window */
|
||||
#ifndef Q_OS_MACOS
|
||||
|
@ -95,6 +95,7 @@ private:
|
||||
QSpinBox *mempoolexpiry;
|
||||
|
||||
QCheckBox *rejectunknownscripts;
|
||||
QSpinBox *bytespersigop, *bytespersigopstrict;
|
||||
};
|
||||
|
||||
#endif // BITCOIN_QT_OPTIONSDIALOG_H
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include <interfaces/node.h>
|
||||
#include <kernel/mempool_options.h> // for DEFAULT_MAX_MEMPOOL_SIZE_MB, DEFAULT_MEMPOOL_EXPIRY_HOURS
|
||||
#include <mapport.h>
|
||||
#include <policy/settings.h>
|
||||
#include <net.h>
|
||||
#include <net_processing.h>
|
||||
#include <netbase.h>
|
||||
@ -641,6 +642,10 @@ QVariant OptionsModel::getOption(OptionID option, const std::string& suffix) con
|
||||
return qlonglong(std::chrono::duration_cast<std::chrono::hours>(node().mempool().m_expiry).count());
|
||||
case rejectunknownscripts:
|
||||
return node().mempool().m_require_standard;
|
||||
case bytespersigop:
|
||||
return nBytesPerSigOp;
|
||||
case bytespersigopstrict:
|
||||
return nBytesPerSigOpStrict;
|
||||
default:
|
||||
return QVariant();
|
||||
}
|
||||
@ -1021,6 +1026,18 @@ bool OptionsModel::setOption(OptionID option, const QVariant& value, const std::
|
||||
}
|
||||
break;
|
||||
}
|
||||
case bytespersigop:
|
||||
if (changed()) {
|
||||
gArgs.ModifyRWConfigFile("bytespersigop", value.toString().toStdString());
|
||||
nBytesPerSigOp = value.toLongLong();
|
||||
}
|
||||
break;
|
||||
case bytespersigopstrict:
|
||||
if (changed()) {
|
||||
gArgs.ModifyRWConfigFile("bytespersigopstrict", value.toString().toStdString());
|
||||
nBytesPerSigOpStrict = value.toLongLong();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -85,6 +85,8 @@ public:
|
||||
maxmempool,
|
||||
mempoolexpiry,
|
||||
rejectunknownscripts, // bool
|
||||
bytespersigop,
|
||||
bytespersigopstrict,
|
||||
OptionIDRowCount,
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user