Changeset View
Changeset View
Standalone View
Standalone View
src/init.cpp
Show First 20 Lines • Show All 745 Lines • ▼ Show 20 Lines | if (showDebug) { | ||||
strprintf( | strprintf( | ||||
"Relay and mine \"non-standard\" transactions (%sdefault: %u)", | "Relay and mine \"non-standard\" transactions (%sdefault: %u)", | ||||
"testnet/regtest only; ", | "testnet/regtest only; ", | ||||
!Params(CBaseChainParams::TESTNET).RequireStandard())); | !Params(CBaseChainParams::TESTNET).RequireStandard())); | ||||
strUsage += | strUsage += | ||||
HelpMessageOpt("-excessiveblocksize=<n>", | HelpMessageOpt("-excessiveblocksize=<n>", | ||||
strprintf(_("Do not accept blocks larger than this " | strprintf(_("Do not accept blocks larger than this " | ||||
"limit, in bytes (default: %d)"), | "limit, in bytes (default: %d)"), | ||||
DEFAULT_MAX_BLOCK_SIZE)); | LEGACY_MAX_BLOCK_SIZE)); | ||||
strUsage += HelpMessageOpt( | strUsage += HelpMessageOpt( | ||||
"-incrementalrelayfee=<amt>", | "-incrementalrelayfee=<amt>", | ||||
strprintf( | strprintf( | ||||
"Fee rate (in %s/kB) used to define cost of relay, used for " | "Fee rate (in %s/kB) used to define cost of relay, used for " | ||||
"mempool limiting and BIP 125 replacement. (default: %s)", | "mempool limiting and BIP 125 replacement. (default: %s)", | ||||
CURRENCY_UNIT, FormatMoney(DEFAULT_INCREMENTAL_RELAY_FEE))); | CURRENCY_UNIT, FormatMoney(DEFAULT_INCREMENTAL_RELAY_FEE))); | ||||
strUsage += HelpMessageOpt( | strUsage += HelpMessageOpt( | ||||
"-dustrelayfee=<amt>", | "-dustrelayfee=<amt>", | ||||
▲ Show 20 Lines • Show All 618 Lines • ▼ Show 20 Lines | bool AppInitParameterInteraction(Config &config) { | ||||
if (nScriptCheckThreads <= 1) | if (nScriptCheckThreads <= 1) | ||||
nScriptCheckThreads = 0; | nScriptCheckThreads = 0; | ||||
else if (nScriptCheckThreads > MAX_SCRIPTCHECK_THREADS) | else if (nScriptCheckThreads > MAX_SCRIPTCHECK_THREADS) | ||||
nScriptCheckThreads = MAX_SCRIPTCHECK_THREADS; | nScriptCheckThreads = MAX_SCRIPTCHECK_THREADS; | ||||
// Configure excessive block size. | // Configure excessive block size. | ||||
const uint64_t nProposedExcessiveBlockSize = | const uint64_t nProposedExcessiveBlockSize = | ||||
GetArg("-excessiveblocksize", DEFAULT_MAX_BLOCK_SIZE); | GetArg("-excessiveblocksize", DEFAULT_MAX_BLOCK_SIZE); | ||||
if (nProposedExcessiveBlockSize < ONE_MEGABYTE) { | |||||
return InitError( | |||||
_("Excessive block size must be >= 1,000,000 bytes (1MB)")); | |||||
} else { | |||||
if (!config.SetMaxBlockSize(nProposedExcessiveBlockSize)) { | if (!config.SetMaxBlockSize(nProposedExcessiveBlockSize)) { | ||||
return InitError(strprintf( | return InitError( | ||||
_("Unable to validate excessive block size value (%d)"), | _("Excessive block size must be > 1,000,000 bytes (1MB)")); | ||||
nProposedExcessiveBlockSize)); | |||||
} | |||||
assert(nProposedExcessiveBlockSize == config.GetMaxBlockSize()); | |||||
} | } | ||||
// Check blockmaxsize does not exceed maximum accepted block size. | // Check blockmaxsize does not exceed maximum accepted block size. | ||||
// Also checks that it isn't smaller than 1MB, as to make sure we can | |||||
// satisfy the "must be big" UAHF rule. | |||||
const uint64_t nProposedMaxGeneratedBlockSize = | const uint64_t nProposedMaxGeneratedBlockSize = | ||||
GetArg("-blockmaxsize", DEFAULT_MAX_GENERATED_BLOCK_SIZE); | GetArg("-blockmaxsize", DEFAULT_MAX_GENERATED_BLOCK_SIZE); | ||||
if (nProposedMaxGeneratedBlockSize > config.GetMaxBlockSize()) { | if (nProposedMaxGeneratedBlockSize <= LEGACY_MAX_BLOCK_SIZE || | ||||
nProposedMaxGeneratedBlockSize > config.GetMaxBlockSize()) { | |||||
return InitError( | return InitError( | ||||
_("Max generated block size (blockmaxsize) cannot exceed the " | _("Max generated block size (blockmaxsize) cannot be lower than " | ||||
"excessive block size (excessiveblocksize)")); | "1MB or exceed the excessive block size (excessiveblocksize)")); | ||||
} | } | ||||
const int64_t nProposedUAHFStartTime = | const int64_t nProposedUAHFStartTime = | ||||
GetArg("-uahfstarttime", DEFAULT_UAHF_START_TIME); | GetArg("-uahfstarttime", DEFAULT_UAHF_START_TIME); | ||||
if (!config.SetUAHFStartTime(nProposedUAHFStartTime)) { | if (!config.SetUAHFStartTime(nProposedUAHFStartTime)) { | ||||
return InitError( | return InitError( | ||||
strprintf(_("Unable to set uahfstarttime to the value (%d)"), | strprintf(_("Unable to set uahfstarttime to the value (%d)"), | ||||
nProposedUAHFStartTime)); | nProposedUAHFStartTime)); | ||||
▲ Show 20 Lines • Show All 754 Lines • Show Last 20 Lines |