Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/init.cpp
Show First 20 Lines • Show All 92 Lines • ▼ Show 20 Lines | gArgs.AddArg( | ||||
CURRENCY_UNIT, | CURRENCY_UNIT, | ||||
FormatMoney(CFeeRate{DEFAULT_PAY_TX_FEE}.GetFeePerK())), | FormatMoney(CFeeRate{DEFAULT_PAY_TX_FEE}.GetFeePerK())), | ||||
ArgsManager::ALLOW_ANY, OptionsCategory::WALLET); | ArgsManager::ALLOW_ANY, OptionsCategory::WALLET); | ||||
gArgs.AddArg( | gArgs.AddArg( | ||||
"-rescan", | "-rescan", | ||||
"Rescan the block chain for missing wallet transactions on startup", | "Rescan the block chain for missing wallet transactions on startup", | ||||
ArgsManager::ALLOW_ANY, OptionsCategory::WALLET); | ArgsManager::ALLOW_ANY, OptionsCategory::WALLET); | ||||
gArgs.AddArg( | gArgs.AddArg( | ||||
"-salvagewallet", | |||||
"Attempt to recover private keys from a corrupt wallet on startup", | |||||
ArgsManager::ALLOW_ANY, OptionsCategory::WALLET); | |||||
gArgs.AddArg( | |||||
"-spendzeroconfchange", | "-spendzeroconfchange", | ||||
strprintf( | strprintf( | ||||
"Spend unconfirmed change when sending transactions (default: %d)", | "Spend unconfirmed change when sending transactions (default: %d)", | ||||
DEFAULT_SPEND_ZEROCONF_CHANGE), | DEFAULT_SPEND_ZEROCONF_CHANGE), | ||||
ArgsManager::ALLOW_ANY, OptionsCategory::WALLET); | ArgsManager::ALLOW_ANY, OptionsCategory::WALLET); | ||||
gArgs.AddArg("-wallet=<path>", | gArgs.AddArg("-wallet=<path>", | ||||
"Specify wallet database path. Can be specified multiple " | "Specify wallet database path. Can be specified multiple " | ||||
"times to load multiple wallets. Path is interpreted relative " | "times to load multiple wallets. Path is interpreted relative " | ||||
▲ Show 20 Lines • Show All 70 Lines • ▼ Show 20 Lines | bool WalletInit::ParameterInteraction() const { | ||||
if (gArgs.GetBoolArg("-blocksonly", DEFAULT_BLOCKSONLY) && | if (gArgs.GetBoolArg("-blocksonly", DEFAULT_BLOCKSONLY) && | ||||
gArgs.SoftSetBoolArg("-walletbroadcast", false)) { | gArgs.SoftSetBoolArg("-walletbroadcast", false)) { | ||||
LogPrintf("%s: parameter interaction: -blocksonly=1 -> setting " | LogPrintf("%s: parameter interaction: -blocksonly=1 -> setting " | ||||
"-walletbroadcast=0\n", | "-walletbroadcast=0\n", | ||||
__func__); | __func__); | ||||
} | } | ||||
if (gArgs.GetBoolArg("-salvagewallet", false)) { | |||||
if (is_multiwallet) { | |||||
return InitError(strprintf( | |||||
Untranslated("%s is only allowed with a single wallet file"), | |||||
"-salvagewallet")); | |||||
} | |||||
// Rewrite just private keys: rescan to find transactions | |||||
if (gArgs.SoftSetBoolArg("-rescan", true)) { | |||||
LogPrintf("%s: parameter interaction: -salvagewallet=1 -> setting " | |||||
"-rescan=1\n", | |||||
__func__); | |||||
} | |||||
} | |||||
bool zapwallettxes = gArgs.GetBoolArg("-zapwallettxes", false); | bool zapwallettxes = gArgs.GetBoolArg("-zapwallettxes", false); | ||||
// -zapwallettxes implies dropping the mempool on startup | // -zapwallettxes implies dropping the mempool on startup | ||||
if (zapwallettxes && gArgs.SoftSetBoolArg("-persistmempool", false)) { | if (zapwallettxes && gArgs.SoftSetBoolArg("-persistmempool", false)) { | ||||
LogPrintf("%s: parameter interaction: -zapwallettxes enabled -> " | LogPrintf("%s: parameter interaction: -zapwallettxes enabled -> " | ||||
"setting -persistmempool=0\n", | "setting -persistmempool=0\n", | ||||
__func__); | __func__); | ||||
} | } | ||||
Show All 32 Lines |