Changeset View
Changeset View
Standalone View
Standalone View
src/init.cpp
Show First 20 Lines • Show All 1,386 Lines • ▼ Show 20 Lines | #endif | ||||
argsman.AddArg("-avaproof", | argsman.AddArg("-avaproof", | ||||
"Avalanche proof to be used by this node (default: none)", | "Avalanche proof to be used by this node (default: none)", | ||||
ArgsManager::ALLOW_ANY, OptionsCategory::AVALANCHE); | ArgsManager::ALLOW_ANY, OptionsCategory::AVALANCHE); | ||||
argsman.AddArg( | argsman.AddArg( | ||||
"-legacyavaproof", | "-legacyavaproof", | ||||
strprintf("Use the legacy avalanche proof format (default: %u)", | strprintf("Use the legacy avalanche proof format (default: %u)", | ||||
AVALANCHE_DEFAULT_LEGACY_PROOF), | AVALANCHE_DEFAULT_LEGACY_PROOF), | ||||
ArgsManager::ALLOW_BOOL, OptionsCategory::AVALANCHE); | ArgsManager::ALLOW_BOOL, OptionsCategory::AVALANCHE); | ||||
argsman.AddArg( | |||||
"-avaproofstakeutxoconfirmations", | |||||
strprintf( | |||||
"Minimum number of confirmations before a stake utxo is mature" | |||||
" enough to be included into a proof (default: %s)", | |||||
AVALANCHE_DEFAULT_STAKE_UTXO_CONFIRMATIONS), | |||||
ArgsManager::ALLOW_INT, OptionsCategory::AVALANCHE); | |||||
argsman.AddArg("-avamasterkey", | argsman.AddArg("-avamasterkey", | ||||
"Master key associated with the proof. If a proof is " | "Master key associated with the proof. If a proof is " | ||||
"required, this is mandatory.", | "required, this is mandatory.", | ||||
ArgsManager::ALLOW_ANY, OptionsCategory::AVALANCHE); | ArgsManager::ALLOW_ANY, OptionsCategory::AVALANCHE); | ||||
argsman.AddArg("-avasessionkey", "Avalanche session key (default: random)", | argsman.AddArg("-avasessionkey", "Avalanche session key (default: random)", | ||||
ArgsManager::ALLOW_ANY, OptionsCategory::AVALANCHE); | ArgsManager::ALLOW_ANY, OptionsCategory::AVALANCHE); | ||||
argsman.AddArg( | argsman.AddArg( | ||||
"-maxavalancheoutbound", | "-maxavalancheoutbound", | ||||
▲ Show 20 Lines • Show All 262 Lines • ▼ Show 20 Lines | void InitParameterInteraction(ArgsManager &args) { | ||||
// If avalanche is set, soft set all the feature flags accordingly. | // If avalanche is set, soft set all the feature flags accordingly. | ||||
if (args.IsArgSet("-avalanche")) { | if (args.IsArgSet("-avalanche")) { | ||||
const bool fAvalanche = | const bool fAvalanche = | ||||
args.GetBoolArg("-avalanche", AVALANCHE_DEFAULT_ENABLED); | args.GetBoolArg("-avalanche", AVALANCHE_DEFAULT_ENABLED); | ||||
args.SoftSetBoolArg("-enableavalanche", fAvalanche); | args.SoftSetBoolArg("-enableavalanche", fAvalanche); | ||||
args.SoftSetBoolArg("-legacyavaproof", | args.SoftSetBoolArg("-legacyavaproof", | ||||
fAvalanche ? false | fAvalanche ? false | ||||
: AVALANCHE_DEFAULT_LEGACY_PROOF); | : AVALANCHE_DEFAULT_LEGACY_PROOF); | ||||
args.SoftSetArg( | |||||
"-avaproofstakeutxoconfirmations", | |||||
fAvalanche ? "2016" | |||||
: ToString(AVALANCHE_DEFAULT_STAKE_UTXO_CONFIRMATIONS)); | |||||
deadalnix: ??????? | |||||
args.SoftSetBoolArg("-enableavalanchepeerdiscovery", fAvalanche); | args.SoftSetBoolArg("-enableavalanchepeerdiscovery", fAvalanche); | ||||
args.SoftSetBoolArg("-enableavalancheproofreplacement", fAvalanche); | args.SoftSetBoolArg("-enableavalancheproofreplacement", fAvalanche); | ||||
args.SoftSetBoolArg("-automaticunparking", !fAvalanche); | args.SoftSetBoolArg("-automaticunparking", !fAvalanche); | ||||
args.SoftSetArg( | args.SoftSetArg( | ||||
"-avaminquorumstake", | "-avaminquorumstake", | ||||
fAvalanche | fAvalanche | ||||
? FormatMoney(int64_t(1'000'000'000'000) * SATOSHI) // 10B XEC | ? FormatMoney(int64_t(1'000'000'000'000) * SATOSHI) // 10B XEC | ||||
: FormatMoney(AVALANCHE_DEFAULT_MIN_QUORUM_STAKE)); | : FormatMoney(AVALANCHE_DEFAULT_MIN_QUORUM_STAKE)); | ||||
▲ Show 20 Lines • Show All 450 Lines • ▼ Show 20 Lines | #endif | ||||
nMaxTipAge = args.GetArg("-maxtipage", DEFAULT_MAX_TIP_AGE); | nMaxTipAge = args.GetArg("-maxtipage", DEFAULT_MAX_TIP_AGE); | ||||
if (args.IsArgSet("-proxy") && args.GetArg("-proxy", "").empty()) { | if (args.IsArgSet("-proxy") && args.GetArg("-proxy", "").empty()) { | ||||
return InitError(_( | return InitError(_( | ||||
"No proxy server specified. Use -proxy=<ip> or -proxy=<ip:port>.")); | "No proxy server specified. Use -proxy=<ip> or -proxy=<ip:port>.")); | ||||
} | } | ||||
// Avalanche parameters | |||||
const int64_t stakeUtxoMinConfirmations = | |||||
gArgs.GetArg("-avaproofstakeutxoconfirmations", | |||||
AVALANCHE_DEFAULT_STAKE_UTXO_CONFIRMATIONS); | |||||
if (!chainparams.IsTestChain() && stakeUtxoMinConfirmations != 2016) { | |||||
return InitError(_("Avalanche stake UTXO minimum confirmations can " | |||||
"only be set on test chains.")); | |||||
} | |||||
return true; | return true; | ||||
} | } | ||||
static bool LockDataDirectory(bool probeOnly) { | static bool LockDataDirectory(bool probeOnly) { | ||||
// Make sure only a single Bitcoin process is using the data directory. | // Make sure only a single Bitcoin process is using the data directory. | ||||
fs::path datadir = GetDataDir(); | fs::path datadir = GetDataDir(); | ||||
if (!DirIsWritable(datadir)) { | if (!DirIsWritable(datadir)) { | ||||
return InitError(strprintf( | return InitError(strprintf( | ||||
▲ Show 20 Lines • Show All 1,011 Lines • Show Last 20 Lines |
???????