mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-05-13 03:30:42 +02:00
Qt/Options: Configure limitancestorsize using rwconf
This commit is contained in:
parent
6bc2bb3520
commit
2b9e07c44f
@ -240,6 +240,11 @@ OptionsDialog::OptionsDialog(QWidget* parent, bool enableWallet)
|
|||||||
limitancestorcount->setMaximum(std::numeric_limits<int>::max());
|
limitancestorcount->setMaximum(std::numeric_limits<int>::max());
|
||||||
CreateOptionUI(verticalLayout_Spamfiltering, limitancestorcount, tr("Ignore transactions with %s or more unconfirmed ancestors."));
|
CreateOptionUI(verticalLayout_Spamfiltering, limitancestorcount, tr("Ignore transactions with %s or more unconfirmed ancestors."));
|
||||||
|
|
||||||
|
limitancestorsize = new QSpinBox(groupBox_Spamfiltering);
|
||||||
|
limitancestorsize->setMinimum(1);
|
||||||
|
limitancestorsize->setMaximum(std::numeric_limits<int>::max());
|
||||||
|
CreateOptionUI(verticalLayout_Spamfiltering, limitancestorsize, tr("Ignore transactions whose size with all unconfirmed ancestors exceeds %s kilobytes."));
|
||||||
|
|
||||||
verticalLayout_Mempool->addWidget(groupBox_Spamfiltering);
|
verticalLayout_Mempool->addWidget(groupBox_Spamfiltering);
|
||||||
|
|
||||||
verticalLayout_Mempool->addItem(new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding));
|
verticalLayout_Mempool->addItem(new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding));
|
||||||
@ -486,6 +491,7 @@ void OptionsDialog::setMapper()
|
|||||||
mapper->addMapping(bytespersigop, OptionsModel::bytespersigop);
|
mapper->addMapping(bytespersigop, OptionsModel::bytespersigop);
|
||||||
mapper->addMapping(bytespersigopstrict, OptionsModel::bytespersigopstrict);
|
mapper->addMapping(bytespersigopstrict, OptionsModel::bytespersigopstrict);
|
||||||
mapper->addMapping(limitancestorcount, OptionsModel::limitancestorcount);
|
mapper->addMapping(limitancestorcount, OptionsModel::limitancestorcount);
|
||||||
|
mapper->addMapping(limitancestorsize, OptionsModel::limitancestorsize);
|
||||||
|
|
||||||
/* Window */
|
/* Window */
|
||||||
#ifndef Q_OS_MACOS
|
#ifndef Q_OS_MACOS
|
||||||
|
@ -97,6 +97,7 @@ private:
|
|||||||
QCheckBox *rejectunknownscripts;
|
QCheckBox *rejectunknownscripts;
|
||||||
QSpinBox *bytespersigop, *bytespersigopstrict;
|
QSpinBox *bytespersigop, *bytespersigopstrict;
|
||||||
QSpinBox *limitancestorcount;
|
QSpinBox *limitancestorcount;
|
||||||
|
QSpinBox *limitancestorsize;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // BITCOIN_QT_OPTIONSDIALOG_H
|
#endif // BITCOIN_QT_OPTIONSDIALOG_H
|
||||||
|
@ -627,6 +627,8 @@ QVariant OptionsModel::getOption(OptionID option, const std::string& suffix) con
|
|||||||
return nBytesPerSigOpStrict;
|
return nBytesPerSigOpStrict;
|
||||||
case limitancestorcount:
|
case limitancestorcount:
|
||||||
return qlonglong(node().mempool().m_limits.ancestor_count);
|
return qlonglong(node().mempool().m_limits.ancestor_count);
|
||||||
|
case limitancestorsize:
|
||||||
|
return qlonglong(node().mempool().m_limits.ancestor_size_vbytes / 1'000);
|
||||||
default:
|
default:
|
||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
@ -1028,6 +1030,15 @@ bool OptionsModel::setOption(OptionID option, const QVariant& value, const std::
|
|||||||
gArgs.ModifyRWConfigFile("limitancestorcount", strNv);
|
gArgs.ModifyRWConfigFile("limitancestorcount", strNv);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case limitancestorsize:
|
||||||
|
if (changed()) {
|
||||||
|
long long nNv = value.toLongLong();
|
||||||
|
std::string strNv = value.toString().toStdString();
|
||||||
|
node().mempool().m_limits.ancestor_size_vbytes = nNv * 1'000;
|
||||||
|
gArgs.ForceSetArg("-limitancestorsize", strNv);
|
||||||
|
gArgs.ModifyRWConfigFile("limitancestorsize", strNv);
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -88,6 +88,7 @@ public:
|
|||||||
bytespersigop,
|
bytespersigop,
|
||||||
bytespersigopstrict,
|
bytespersigopstrict,
|
||||||
limitancestorcount,
|
limitancestorcount,
|
||||||
|
limitancestorsize,
|
||||||
OptionIDRowCount,
|
OptionIDRowCount,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user