View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -8,11 +8,18 @@
#include <QDialog>
#include <QValidator>
+class BitcoinAmountField;
class OptionsModel;
class QValidatedLineEdit;
QT_BEGIN_NAMESPACE
+class QBoxLayout;
+class QCheckBox;
+class QValueComboBox;
class QDataWidgetMapper;
+class QSpinBox;
+class QString;
+class QWidget;
QT_END_NAMESPACE
namespace Ui {
@@ -60,13 +67,49 @@ private Q_SLOTS:
void checkLineEdit();
void maxuploadtargetCheckboxStateChanged(int);
+ void incrementalrelayfee_changed();
+ void blockmaxsize_changed(int);
+ void blockmaxsize_increase(int);
+ void blockmaxweight_changed(int);
+
Q_SIGNALS:
void proxyIpChecks(QValidatedLineEdit *pUiProxyIp, int nProxyPort);
private:
Ui::OptionsDialog *ui;
OptionsModel *model;
QDataWidgetMapper *mapper;
+
+ QWidget *prevwidget;
+ void FixTabOrder(QWidget *);
+ void CreateOptionUI(QBoxLayout *, QWidget *, const QString& text);
+
+ QCheckBox *walletrbf;
+
+ QSpinBox *blockreconstructionextratxn;
+
+ QValueComboBox *mempoolreplacement;
+ QSpinBox *maxorphantx;
+ BitcoinAmountField *incrementalrelayfee;
+ QSpinBox *maxmempool;
+ QSpinBox *mempoolexpiry;
+
+ QCheckBox *rejectunknownscripts;
+ QCheckBox *rejectspkreuse;
+ BitcoinAmountField *minrelaytxfee;
+ QSpinBox *bytespersigop, *bytespersigopstrict;
+ QSpinBox *limitancestorcount;
+ QSpinBox *limitancestorsize;
+ QSpinBox *limitdescendantcount;
+ QSpinBox *limitdescendantsize;
+ QCheckBox *spamfilter;
+ QCheckBox *rejectbaremultisig;
+ QSpinBox *datacarriersize;
+ BitcoinAmountField *dustrelayfee;
+
+ BitcoinAmountField *blockmintxfee;
+ QSpinBox *blockmaxsize, *blockprioritysize, *blockmaxweight;
+ QCheckBox *priorityaccurate;
};
#endif // BITCOIN_QT_OPTIONSDIALOG_H
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -43,13 +43,39 @@ class OptionsModel : public QAbstractListModel
DisplayAddresses, // bool
ThirdPartyTxUrls, // QString
Language, // QString
+ walletrbf, // bool
CoinControlFeatures, // bool
ThreadsScriptVerif, // int
DatabaseCache, // int
SpendZeroConfChange, // bool
Listen, // bool
maxuploadtarget,
peerbloomfilters, // bool
+ blockreconstructionextratxn,
+ mempoolreplacement,
+ maxorphantx,
+ maxmempool,
+ incrementalrelayfee,
+ mempoolexpiry,
+ rejectunknownscripts, // bool
+ rejectspkreuse, // bool
+ minrelaytxfee,
+ bytespersigop,
+ bytespersigopstrict,
+ limitancestorcount,
+ limitancestorsize,
+ limitdescendantcount,
+ limitdescendantsize,
+ spamfilter, // bool
+ rejectbaremultisig, // bool
+ datacarriersize,
+ dustrelayfee,
+ blockmintxfee,
+ blockmaxsize,
+ blockprioritysize,
+ blockmaxweight,
+ priorityaccurate, // bool
+ corepolicy,
OptionIDRowCount,
};
@@ -92,6 +118,7 @@ class OptionsModel : public QAbstractListModel
/* rwconf settings that require a restart */
bool f_peerbloomfilters;
+ bool f_rejectspkreuse;
// Add option to list of GUI options overridden through command line/config file
void addOverriddenOption(const std::string &option);
View
@@ -27,7 +27,7 @@ class CScriptID : public uint160
CScriptID(const uint160& in) : uint160(in) {}
};
-static const unsigned int MAX_OP_RETURN_RELAY = 83; //!< bytes (+1 for OP_RETURN, +2 for the pushdata opcodes)
+static const unsigned int MAX_OP_RETURN_RELAY = 42; //!< bytes (+1 for OP_RETURN, +1 for the pushdata opcode)
extern bool fAcceptDatacarrier;
extern unsigned nMaxDatacarrierBytes;
View
@@ -186,6 +186,8 @@ void TestPackageSelection(const CChainParams& chainparams, CScript scriptPubKey,
BOOST_AUTO_TEST_CASE(CreateNewBlock_validity)
{
// Note that by default, these tests run with size accounting enabled.
+ SetArg("-blockprioritysize", "0");
+
const CChainParams& chainparams = Params(CBaseChainParams::MAIN);
CScript scriptPubKey = CScript() << ParseHex("04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f") << OP_CHECKSIG;
std::unique_ptr<CBlockTemplate> pblocktemplate;
View
@@ -193,7 +193,7 @@ BOOST_AUTO_TEST_CASE(set)
txTo[i].vin[0].prevout.n = i;
txTo[i].vin[0].prevout.hash = txFrom.GetHash();
txTo[i].vout[0].nValue = 1*CENT;
- txTo[i].vout[0].scriptPubKey = inner[i];
+ txTo[i].vout[0].scriptPubKey = outer[i];
BOOST_CHECK_MESSAGE(IsMine(keystore, txFrom.vout[i].scriptPubKey), strprintf("IsMine %d", i));
}
for (int i = 0; i < 4; i++)
View
@@ -714,12 +714,15 @@ BOOST_AUTO_TEST_CASE(test_IsStandard)
BOOST_CHECK(!IsStandardTx(t, reason));
// MAX_OP_RETURN_RELAY-byte TX_NULL_DATA (standard)
- t.vout[0].scriptPubKey = CScript() << OP_RETURN << ParseHex("04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef3804678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38");
+ t.vout[0].scriptPubKey = CScript() << OP_RETURN;
+ while (t.vout[0].scriptPubKey.size() < MAX_OP_RETURN_RELAY) {
+ t.vout[0].scriptPubKey += CScript(OP_0);
+ }
BOOST_CHECK_EQUAL(MAX_OP_RETURN_RELAY, t.vout[0].scriptPubKey.size());
BOOST_CHECK(IsStandardTx(t, reason));
// MAX_OP_RETURN_RELAY+1-byte TX_NULL_DATA (non-standard)
- t.vout[0].scriptPubKey = CScript() << OP_RETURN << ParseHex("04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef3804678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef3800");
+ t.vout[0].scriptPubKey += CScript(OP_0);
BOOST_CHECK_EQUAL(MAX_OP_RETURN_RELAY + 1, t.vout[0].scriptPubKey.size());
BOOST_CHECK(!IsStandardTx(t, reason));
View
@@ -19,6 +19,8 @@
#include "utiltime.h"
#include "version.h"
+bool fPriorityAccurate = DEFAULT_PRIORITY_ACCURATE;
+
CTxMemPoolEntry::CTxMemPoolEntry(const CTransactionRef& _tx, const CAmount& _nFee,
int64_t _nTime, double _entryPriority, unsigned int _entryHeight,
CAmount _inChainInputValue,
@@ -370,8 +372,10 @@ void CTxMemPoolEntry::UpdateCachedPriority(unsigned int currentHeight, CAmount v
double deltaPriority = ((double)heightDiff*inChainInputValue)/nModSize;
cachedPriority += deltaPriority;
cachedHeight = currentHeight;
- inChainInputValue += valueInCurrentBlock;
- assert(MoneyRange(inChainInputValue));
+ if (fPriorityAccurate) {
+ inChainInputValue += valueInCurrentBlock;
+ assert(MoneyRange(inChainInputValue));
+ }
}
CTxMemPool::CTxMemPool(const CFeeRate& _minReasonableRelayFee) :
View
@@ -29,10 +29,18 @@
#include <boost/signals2/signal.hpp>
+static const bool DEFAULT_PRIORITY_ACCURATE = true;
+extern bool fPriorityAccurate;
+
class CAutoFile;
class CBlockIndex;
class CScript;
+inline int64_t maxmempoolMinimum(const int64_t nLimitDescendantSize) {
+ int64_t nMempoolSizeMin = nLimitDescendantSize * 1000 * 40;
+ return std::max(int64_t(0), int64_t(std::ceil(nMempoolSizeMin / 1000000.0)));
+}
+
inline double AllowFreeThreshold()
{
return COIN * 144 / 250;
View
@@ -617,6 +617,7 @@ static void ReadConfigFile(boost::filesystem::ifstream& streamConfig, std::set<s
}
static std::set<std::string> setConfigAssigned;
+static bool fRWConfigHadPruneOption;
void ReadConfigFile(const std::string& mainconfPath)
{
@@ -627,8 +628,15 @@ void ReadConfigFile(const std::string& mainconfPath)
void ReadRWConfigFile()
{
boost::filesystem::ifstream streamRWConfig(GetRWConfigFile());
- ReadConfigFile(streamRWConfig, &setConfigAssigned, NULL);
+ std::set<std::string> setRWConfigAssigned;
+ ReadConfigFile(streamRWConfig, &setConfigAssigned, &setRWConfigAssigned);
setConfigAssigned.clear();
+ fRWConfigHadPruneOption = (setRWConfigAssigned.find("prune") != setRWConfigAssigned.end());
+}
+
+bool RWConfigHasPruneOption()
+{
+ return fRWConfigHadPruneOption;
}
// Like std::getline, but includes the EOL character in the result
View
@@ -110,6 +110,7 @@ void CreatePidFile(const boost::filesystem::path &path, pid_t pid);
#endif
void ReadConfigFile(const std::string& confPath);
void ReadRWConfigFile();
+bool RWConfigHasPruneOption();
void ModifyRWConfigFile(std::istream& streamIn, std::ostream& streamOut, const std::map<std::string, std::string>& mapChangeSettings);
void ModifyRWConfigFile(const std::map<std::string, std::string>& mapChangeSettings);
void ModifyRWConfigFile(const std::string& strArg, const std::string& strNewValue);
View
@@ -581,6 +581,10 @@ void LimitMempoolSize(CTxMemPool& pool, size_t limit, unsigned long age) {
pcoinsTip->Uncache(removed);
}
+void LimitMempoolSize() {
+ LimitMempoolSize(mempool, GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000, GetArg("-mempoolexpiry", DEFAULT_MEMPOOL_EXPIRY) * 60 * 60);
+}
+
struct NotoriousFilterEntry {
uint32_t begin;
uint32_t end;
View
@@ -131,7 +131,7 @@ static const int64_t DEFAULT_MAX_TIP_AGE = 24 * 60 * 60;
static const int64_t MAX_FEE_ESTIMATION_TIP_AGE = 3 * 60 * 60;
/** Default for -permitbaremultisig */
-static const bool DEFAULT_PERMIT_BAREMULTISIG = true;
+static const bool DEFAULT_PERMIT_BAREMULTISIG = false;
static const bool DEFAULT_CHECKPOINTS_ENABLED = true;
static const bool DEFAULT_TXINDEX = false;
static const unsigned int DEFAULT_BANSCORE_THRESHOLD = 100;
@@ -330,6 +330,8 @@ void PruneAndFlush();
/** Prune block files up to a given height */
void PruneBlockFilesManual(int nPruneUpToHeight);
+void LimitMempoolSize();
+
/** (try to) add transaction to memory pool
* plTxnReplaced will be appended to with all transactions replaced from mempool **/
bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransactionRef &tx, bool fLimitFree,
@@ -427,6 +429,8 @@ bool CheckTxInputs(const CTransaction& tx, CValidationState& state, const CCoins
} // namespace Consensus
+unsigned int LimitOrphanTxSize(unsigned int nMaxOrphans) EXCLUSIVE_LOCKS_REQUIRED(cs_main);
+
/**
* Check if transaction is final and can be included in a block with the
* specified height and time. Consensus critical.