Permalink
Browse files

Merge branch 'rwconf_policy' into 0.13.x-knots

2 parents 9088e2e + 2185e93 commit 5c66cc1ced2ea2d7e58a5d40f6e2276b109a0496 @luke-jr luke-jr committed Aug 13, 2016
View
@@ -64,6 +64,7 @@
using namespace std;
bool fFeeEstimatesInitialized = false;
+static const bool DEFAULT_COREPOLICY = false;
static const bool DEFAULT_PROXYRANDOMIZE = true;
static const bool DEFAULT_REST_ENABLE = false;
static const bool DEFAULT_DISABLE_SAFEMODE = false;
@@ -318,6 +319,7 @@ std::string HelpMessage(HelpMessageMode mode)
strUsage += HelpMessageOpt("-checklevel=<n>", strprintf(_("How thorough the block verification of -checkblocks is (0-4, default: %u)"), DEFAULT_CHECKLEVEL));
strUsage += HelpMessageOpt("-conf=<file>", strprintf(_("Specify configuration file (default: %s)"), BITCOIN_CONF_FILENAME));
strUsage += HelpMessageOpt("-confrw=<file>", strprintf(_("Specify read/write configuration file (default: %s)"), BITCOIN_RW_CONF_FILENAME));
+ strUsage += HelpMessageOpt("-corepolicy", strprintf(_("Use Bitcoin Core policy defaults (default: %s)"), DEFAULT_COREPOLICY));
if (mode == HMM_BITCOIND)
{
#ifndef WIN32
@@ -467,6 +469,7 @@ std::string HelpMessage(HelpMessageMode mode)
strUsage += HelpMessageOpt("-blockprioritysize=<n>", strprintf(_("Set maximum size of high-priority/low-fee transactions in bytes (default: %d)"), DEFAULT_BLOCK_PRIORITY_SIZE));
if (showDebug)
strUsage += HelpMessageOpt("-blockversion=<n>", "Override block version to test forking scenarios");
+ strUsage += HelpMessageOpt("-priorityaccurate", strprintf(_("Update coin-age priority accurately when parent transactions are confirmed (default: %d)"), fPriorityAccurate));
strUsage += HelpMessageGroup(_("RPC server options:"));
#ifdef USE_LIBEVENT
@@ -681,6 +684,17 @@ bool AppInitServers(boost::thread_group& threadGroup)
// Parameter interaction based on rules
void InitParameterInteraction()
{
+ if (GetBoolArg("-corepolicy", DEFAULT_COREPOLICY)) {
+ SoftSetArg("-bytespersigopstrict", "0");
+ SoftSetArg("-spamfilter", "0");
+ SoftSetArg("-permitbaremultisig", "1");
+ SoftSetArg("-datacarriersize", "83");
+
+ SoftSetArg("-blockprioritysize", "0");
+ SoftSetArg("-priorityaccurate", "0");
+ SoftSetArg("-blockmaxsize", "750000");
+ }
+
// when specifying an explicit binding address, you want to listen on it
// even when -connect or -proxy is specified
if (mapArgs.count("-bind")) {
@@ -874,6 +888,8 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
if (GetBoolArg("-nodebug", false) || find(categories.begin(), categories.end(), string("0")) != categories.end())
fDebug = false;
+ fPriorityAccurate = GetBoolArg("-priorityaccurate", fPriorityAccurate);
+
// Check for -debugnet
if (GetBoolArg("-debugnet", false))
InitWarning(_("Unsupported argument -debugnet ignored, use -debug=net."));
@@ -902,10 +918,10 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
fCheckpointsEnabled = GetBoolArg("-checkpoints", DEFAULT_CHECKPOINTS_ENABLED);
// mempool limits
- int64_t nMempoolSizeMax = GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000;
- int64_t nMempoolSizeMin = GetArg("-limitdescendantsize", DEFAULT_DESCENDANT_SIZE_LIMIT) * 1000 * 40;
- if (nMempoolSizeMax < 0 || nMempoolSizeMax < nMempoolSizeMin)
- return InitError(strprintf(_("-maxmempool must be at least %d MB"), std::ceil(nMempoolSizeMin / 1000000.0)));
+ int64_t nMempoolSizeMaxMB = GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE);
+ int64_t nMempoolSizeMinMB = maxmempoolMinimum(GetArg("-limitdescendantsize", DEFAULT_DESCENDANT_SIZE_LIMIT));
+ if (nMempoolSizeMaxMB < 0 || nMempoolSizeMaxMB < nMempoolSizeMinMB)
+ return InitError(strprintf(_("-maxmempool must be at least %d MB"), nMempoolSizeMinMB));
// -par=0 means autodetect, but nScriptCheckThreads==0 means no concurrency
nScriptCheckThreads = GetArg("-par", DEFAULT_SCRIPTCHECK_THREADS);
View
@@ -1142,6 +1142,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;
@@ -1400,7 +1404,7 @@ bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState& state, const C
CAmount inChainInputValue;
// Since entries arrive *after* the tip's height, their priority is for the height+1
- double dPriority = view.GetPriority(tx, chainActive.Height() + 1, inChainInputValue);
+ double dPriority = view.GetPriority(tx, chainActive.Height() + (fPriorityAccurate ? 1 : 0), inChainInputValue);
// Keep track of transactions that spend a coinbase, which we re-scan
// during reorgs to ensure COINBASE_MATURITY is still met.
View
@@ -125,7 +125,7 @@ static const bool DEFAULT_RELAYPRIORITY = true;
static const int64_t DEFAULT_MAX_TIP_AGE = 24 * 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;
@@ -301,6 +301,8 @@ void FlushStateToDisk();
/** Prune block files and flush state to disk. */
void PruneAndFlush();
+void LimitMempoolSize();
+
/** (try to) add transaction to memory pool **/
bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransaction &tx, bool fLimitFree,
bool* pfMissingInputs, const CAmount nAbsurdFee, const std::set<std::string>& setIgnoreRejects);
@@ -374,6 +376,8 @@ void UpdateCoins(const CTransaction& tx, CCoinsViewCache& inputs, int nHeight);
/** Context-independent validity checks */
bool CheckTransaction(const CTransaction& tx, CValidationState& state);
+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.
View
@@ -15,9 +15,9 @@
class CCoinsViewCache;
/** Default for -blockmaxsize, which controls the maximum size of block the mining code will create **/
-static const unsigned int DEFAULT_BLOCK_MAX_SIZE = 750000;
+static const unsigned int DEFAULT_BLOCK_MAX_SIZE = 500000;
/** Default for -blockprioritysize, maximum space for zero/low-fee transactions **/
-static const unsigned int DEFAULT_BLOCK_PRIORITY_SIZE = 0;
+static const unsigned int DEFAULT_BLOCK_PRIORITY_SIZE = 100000;
/** Default for -blockmaxweight, which controls the range of block weights the mining code will create **/
static const unsigned int DEFAULT_BLOCK_MAX_WEIGHT = 3000000;
/** The maximum weight for transactions we're willing to relay/mine */
Oops, something went wrong.

0 comments on commit 5c66cc1

Please sign in to comment.