Permalink
Browse files

Merge rwconf_policy-0.17+knots

  • Loading branch information...
luke-jr committed Dec 28, 2018
2 parents e52fa51 + 278758d commit c3488b608eab620d809722402ccdee48f45bef31
@@ -72,6 +72,7 @@
#endif

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_STOPAFTERBLOCKIMPORT = false;
@@ -369,6 +370,7 @@ void SetupServerArgs()
gArgs.AddArg("-blocksonly", strprintf("Whether to operate in a blocks only mode (default: %u)", DEFAULT_BLOCKSONLY), true, OptionsCategory::OPTIONS);
gArgs.AddArg("-conf=<file>", strprintf("Specify configuration file. Relative paths will be prefixed by datadir location. (default: %s)", BITCOIN_CONF_FILENAME), false, OptionsCategory::OPTIONS);
gArgs.AddArg("-confrw=<file>", strprintf("Specify read/write configuration file. Relative paths will be prefixed by the network-specific datadir location. (default: %s)", BITCOIN_RW_CONF_FILENAME), false, OptionsCategory::OPTIONS);
gArgs.AddArg("-corepolicy", strprintf("Use Bitcoin Core policy defaults (default: %s)", DEFAULT_COREPOLICY), false, OptionsCategory::OPTIONS);
gArgs.AddArg("-datadir=<dir>", "Specify data directory", false, OptionsCategory::OPTIONS);
gArgs.AddArg("-dbbatchsize", strprintf("Maximum database write batch size in bytes (default: %u)", nDefaultDbBatchSize), true, OptionsCategory::OPTIONS);
gArgs.AddArg("-dbcache=<n>", strprintf("Set database cache size in megabytes (%d to %d, default: %d)", nMinDbCache, nMaxDbCache, nDefaultDbCache), false, OptionsCategory::OPTIONS);
@@ -781,6 +783,18 @@ static bool AppInitServers()
// Parameter interaction based on rules
void InitParameterInteraction()
{
if (gArgs.GetBoolArg("-corepolicy", DEFAULT_COREPOLICY)) {
gArgs.SoftSetArg("-bytespersigopstrict", "0");
gArgs.SoftSetArg("-permitbaremultisig", "1");
gArgs.SoftSetArg("-datacarriersize", "83");

gArgs.SoftSetArg("-mempoolreplacement", "fee,optin");
gArgs.SoftSetArg("-spkreuse", "allow");
gArgs.SoftSetArg("-blockprioritysize", "0");
gArgs.SoftSetArg("-blockmaxsize", "4000000");
gArgs.SoftSetArg("-blockmaxweight", "3996000");
}

// when specifying an explicit binding address, you want to listen on it
// even when -connect or -proxy is specified
if (gArgs.IsArgSet("-bind")) {
@@ -1065,7 +1079,7 @@ bool AppInitParameterInteraction()

// mempool limits
int64_t nMempoolSizeMax = gArgs.GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000;
int64_t nMempoolSizeMin = gArgs.GetArg("-limitdescendantsize", DEFAULT_DESCENDANT_SIZE_LIMIT) * 1000 * 40;
int64_t nMempoolSizeMin = maxmempoolMinimum(gArgs.GetArg("-limitdescendantsize", DEFAULT_DESCENDANT_SIZE_LIMIT)) * 1000000;
if (nMempoolSizeMax < 0 || nMempoolSizeMax < nMempoolSizeMin)
return InitError(strprintf(_("-maxmempool must be at least %d MB"), std::ceil(nMempoolSizeMin / 1000000.0)));
// incremental relay fee sets the minimum feerate increase necessary for BIP 125 replacement in the mempool
@@ -1182,7 +1196,7 @@ bool AppInitParameterInteraction()
boost::split(vstrReplacementModes, strReplacementModeList, boost::is_any_of(",+"));
fEnableReplacement = (std::find(vstrReplacementModes.begin(), vstrReplacementModes.end(), "fee") != vstrReplacementModes.end());
if (fEnableReplacement) {
fReplacementHonourOptOut = (std::find(vstrReplacementModes.begin(), vstrReplacementModes.end(), "-optin") == vstrReplacementModes.end());
fReplacementHonourOptOut = (std::find(vstrReplacementModes.begin(), vstrReplacementModes.end(), "optin") != vstrReplacementModes.end());
if (!fReplacementHonourOptOut) {
nLocalServices = ServiceFlags(nLocalServices | NODE_REPLACE_BY_FEE);
}
@@ -7,9 +7,13 @@
#define BITCOIN_NET_PROCESSING_H

#include <net.h>
#include <sync.h>
#include <threadsafety.h>
#include <validationinterface.h>
#include <consensus/params.h>

extern CCriticalSection cs_main;

/** Default for -maxorphantx, maximum number of orphan transactions kept in memory */
static const unsigned int DEFAULT_MAX_ORPHAN_TRANSACTIONS = 100;
/** Default number of orphan+recently-replaced txn to keep around for block reconstruction */
@@ -83,5 +87,6 @@ struct CNodeStateStats {

/** Get statistics from node state */
bool GetNodeStateStats(NodeId nodeid, CNodeStateStats &stats);
unsigned int LimitOrphanTxSize(unsigned int nMaxOrphans) EXCLUSIVE_LOCKS_REQUIRED(cs_main);

#endif // BITCOIN_NET_PROCESSING_H
@@ -18,13 +18,13 @@ class CCoinsViewCache;
class CTxOut;

/** Default for -blockmaxsize, which controls the maximum size of block the mining code will create **/
static const unsigned int DEFAULT_BLOCK_MAX_SIZE = MAX_BLOCK_SERIALIZED_SIZE;
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;
/** Minimum priority for transactions to be accepted into the priority area **/
static const double MINIMUM_TX_PRIORITY = COIN * 144 / 250;
/** Default for -blockmaxweight, which controls the range of block weights the mining code will create **/
static const unsigned int DEFAULT_BLOCK_MAX_WEIGHT = MAX_BLOCK_WEIGHT - 4000;
static const unsigned int DEFAULT_BLOCK_MAX_WEIGHT = 3000000;
/** Default for -blockmintxfee, which sets the minimum feerate for a transaction in blocks created by mining code **/
static const unsigned int DEFAULT_BLOCK_MIN_TX_FEE = 1000;
/** The maximum weight for transactions we're willing to relay/mine */
Oops, something went wrong.

0 comments on commit c3488b6

Please sign in to comment.