Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/init.cpp
Show First 20 Lines • Show All 154 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 (gArgs.GetBoolArg("-salvagewallet", false)) { | ||||
gArgs.SoftSetBoolArg("-rescan", true)) { | |||||
if (is_multiwallet) { | if (is_multiwallet) { | ||||
return InitError( | return InitError( | ||||
strprintf("%s is only allowed with a single wallet file", | strprintf("%s is only allowed with a single wallet file", | ||||
"-salvagewallet")); | "-salvagewallet")); | ||||
} | } | ||||
// Rewrite just private keys: rescan to find transactions | // Rewrite just private keys: rescan to find transactions | ||||
if (gArgs.SoftSetBoolArg("-rescan", true)) { | |||||
LogPrintf("%s: parameter interaction: -salvagewallet=1 -> setting " | LogPrintf("%s: parameter interaction: -salvagewallet=1 -> setting " | ||||
"-rescan=1\n", | "-rescan=1\n", | ||||
__func__); | __func__); | ||||
} | } | ||||
} | |||||
int zapwallettxes = gArgs.GetArg("-zapwallettxes", 0); | int zapwallettxes = gArgs.GetArg("-zapwallettxes", 0); | ||||
// -zapwallettxes implies dropping the mempool on startup | // -zapwallettxes implies dropping the mempool on startup | ||||
if (zapwallettxes != 0 && gArgs.SoftSetBoolArg("-persistmempool", false)) { | if (zapwallettxes != 0 && gArgs.SoftSetBoolArg("-persistmempool", false)) { | ||||
LogPrintf("%s: parameter interaction: -zapwallettxes=%s -> setting " | LogPrintf("%s: parameter interaction: -zapwallettxes=%s -> setting " | ||||
"-persistmempool=0\n", | "-persistmempool=0\n", | ||||
__func__, zapwallettxes); | __func__, zapwallettxes); | ||||
} | } | ||||
// -zapwallettxes implies a rescan | // -zapwallettxes implies a rescan | ||||
if (zapwallettxes != 0) { | if (zapwallettxes != 0) { | ||||
if (is_multiwallet) { | if (is_multiwallet) { | ||||
return InitError( | return InitError( | ||||
strprintf("%s is only allowed with a single wallet file", | strprintf("%s is only allowed with a single wallet file", | ||||
"-zapwallettxes")); | "-zapwallettxes")); | ||||
} | } | ||||
if (gArgs.SoftSetBoolArg("-rescan", true)) { | if (gArgs.SoftSetBoolArg("-rescan", true)) { | ||||
LogPrintf("%s: parameter interaction: -zapwallettxes=%s -> setting " | LogPrintf("%s: parameter interaction: -zapwallettxes=<mode> -> " | ||||
"-rescan=1\n", | "setting -rescan=1\n", | ||||
__func__, zapwallettxes); | |||||
} | |||||
LogPrintf("%s: parameter interaction: -zapwallettxes=<mode> -> setting " | |||||
"-rescan=1\n", | |||||
__func__); | __func__); | ||||
} | } | ||||
} | |||||
if (is_multiwallet) { | if (is_multiwallet) { | ||||
if (gArgs.GetBoolArg("-upgradewallet", false)) { | if (gArgs.GetBoolArg("-upgradewallet", false)) { | ||||
return InitError( | return InitError( | ||||
strprintf("%s is only allowed with a single wallet file", | strprintf("%s is only allowed with a single wallet file", | ||||
"-upgradewallet")); | "-upgradewallet")); | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 169 Lines • Show Last 20 Lines |