mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-05-13 03:30:42 +02:00
Qt/Options: Configure acceptnonstdtxn using rwconf
This commit is contained in:
parent
8ae6db8db1
commit
5f4b95ab8e
@ -223,7 +223,11 @@ OptionsDialog::OptionsDialog(QWidget* parent, bool enableWallet)
|
|||||||
groupBox_Spamfiltering->setTitle(tr("Spam filtering"));
|
groupBox_Spamfiltering->setTitle(tr("Spam filtering"));
|
||||||
QVBoxLayout * const verticalLayout_Spamfiltering = new QVBoxLayout(groupBox_Spamfiltering);
|
QVBoxLayout * const verticalLayout_Spamfiltering = new QVBoxLayout(groupBox_Spamfiltering);
|
||||||
|
|
||||||
// TODO
|
rejectunknownscripts = new QCheckBox(groupBox_Spamfiltering);
|
||||||
|
rejectunknownscripts->setText(tr("Ignore unrecognised receiver scripts"));
|
||||||
|
rejectunknownscripts->setToolTip(tr("With this option enabled, unrecognised receiver (\"pubkey\") scripts will be ignored. Unrecognisable scripts could be used to bypass further spam filters. If your software is outdated, they may also be used to trick you into thinking you were sent bitcoins that will never confirm."));
|
||||||
|
verticalLayout_Spamfiltering->addWidget(rejectunknownscripts);
|
||||||
|
FixTabOrder(rejectunknownscripts);
|
||||||
|
|
||||||
verticalLayout_Mempool->addWidget(groupBox_Spamfiltering);
|
verticalLayout_Mempool->addWidget(groupBox_Spamfiltering);
|
||||||
|
|
||||||
@ -475,6 +479,8 @@ void OptionsDialog::setMapper()
|
|||||||
mapper->addMapping(maxmempool, OptionsModel::maxmempool);
|
mapper->addMapping(maxmempool, OptionsModel::maxmempool);
|
||||||
mapper->addMapping(mempoolexpiry, OptionsModel::mempoolexpiry);
|
mapper->addMapping(mempoolexpiry, OptionsModel::mempoolexpiry);
|
||||||
|
|
||||||
|
mapper->addMapping(rejectunknownscripts, OptionsModel::rejectunknownscripts);
|
||||||
|
|
||||||
/* Window */
|
/* Window */
|
||||||
#ifndef Q_OS_MACOS
|
#ifndef Q_OS_MACOS
|
||||||
if (QSystemTrayIcon::isSystemTrayAvailable()) {
|
if (QSystemTrayIcon::isSystemTrayAvailable()) {
|
||||||
|
@ -14,6 +14,7 @@ class QValidatedLineEdit;
|
|||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
class QBoxLayout;
|
class QBoxLayout;
|
||||||
|
class QCheckBox;
|
||||||
class QDataWidgetMapper;
|
class QDataWidgetMapper;
|
||||||
class QSpinBox;
|
class QSpinBox;
|
||||||
class QString;
|
class QString;
|
||||||
@ -92,6 +93,8 @@ private:
|
|||||||
QSpinBox *maxorphantx;
|
QSpinBox *maxorphantx;
|
||||||
QSpinBox *maxmempool;
|
QSpinBox *maxmempool;
|
||||||
QSpinBox *mempoolexpiry;
|
QSpinBox *mempoolexpiry;
|
||||||
|
|
||||||
|
QCheckBox *rejectunknownscripts;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // BITCOIN_QT_OPTIONSDIALOG_H
|
#endif // BITCOIN_QT_OPTIONSDIALOG_H
|
||||||
|
@ -643,6 +643,8 @@ QVariant OptionsModel::getOption(OptionID option, const std::string& suffix) con
|
|||||||
return qlonglong(node().mempool().m_opts.max_size_bytes / 1'000'000);
|
return qlonglong(node().mempool().m_opts.max_size_bytes / 1'000'000);
|
||||||
case mempoolexpiry:
|
case mempoolexpiry:
|
||||||
return qlonglong(std::chrono::duration_cast<std::chrono::hours>(node().mempool().m_opts.expiry).count());
|
return qlonglong(std::chrono::duration_cast<std::chrono::hours>(node().mempool().m_opts.expiry).count());
|
||||||
|
case rejectunknownscripts:
|
||||||
|
return node().mempool().m_opts.require_standard;
|
||||||
default:
|
default:
|
||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
@ -1014,6 +1016,16 @@ bool OptionsModel::setOption(OptionID option, const QVariant& value, const std::
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case rejectunknownscripts:
|
||||||
|
{
|
||||||
|
if (changed()) {
|
||||||
|
const bool fNewValue = value.toBool();
|
||||||
|
node().mempool().m_opts.require_standard = fNewValue;
|
||||||
|
// This option is inverted in the config:
|
||||||
|
gArgs.ModifyRWConfigFile("acceptnonstdtxn", strprintf("%d", ! fNewValue));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -84,6 +84,7 @@ public:
|
|||||||
maxorphantx,
|
maxorphantx,
|
||||||
maxmempool,
|
maxmempool,
|
||||||
mempoolexpiry,
|
mempoolexpiry,
|
||||||
|
rejectunknownscripts, // bool
|
||||||
OptionIDRowCount,
|
OptionIDRowCount,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user