Merge #10816: Properly forbid -salvagewallet and -zapwallettxes for multi wallet.
dd97a529a Properly forbid -salvagewallet and -zapwallettxes for multi wallet. (Alex Morcos) Tree-SHA512: dcde8f854ae957b4d3af4bcf1b811e0b6e9b93602764f86499e46a28d304cd4ee93ba058c03f6ca74ccb60e1310c83e53b698c64d93e5503115377655b80d44d
This commit is contained in:
parent
29760e78bc
commit
38f52f881d
@ -5131,20 +5131,24 @@ bool CWallet::ParameterInteraction()
|
||||
LogPrintf("%s: parameter interaction: -blocksonly=1 -> setting -walletbroadcast=0\n", __func__);
|
||||
}
|
||||
|
||||
if (gArgs.GetBoolArg("-salvagewallet", false) && gArgs.SoftSetBoolArg("-rescan", true)) {
|
||||
if (gArgs.GetBoolArg("-salvagewallet", false)) {
|
||||
if (is_multiwallet) {
|
||||
return InitError(strprintf("%s is only allowed with a single wallet file", "-salvagewallet"));
|
||||
}
|
||||
// Rewrite just private keys: rescan to find transactions
|
||||
LogPrintf("%s: parameter interaction: -salvagewallet=1 -> setting -rescan=1\n", __func__);
|
||||
if (gArgs.SoftSetBoolArg("-rescan", true)) {
|
||||
LogPrintf("%s: parameter interaction: -salvagewallet=1 -> setting -rescan=1\n", __func__);
|
||||
}
|
||||
}
|
||||
|
||||
// -zapwallettx implies a rescan
|
||||
if (gArgs.GetBoolArg("-zapwallettxes", false) && gArgs.SoftSetBoolArg("-rescan", true)) {
|
||||
if (gArgs.GetBoolArg("-zapwallettxes", false)) {
|
||||
if (is_multiwallet) {
|
||||
return InitError(strprintf("%s is only allowed with a single wallet file", "-zapwallettxes"));
|
||||
}
|
||||
LogPrintf("%s: parameter interaction: -zapwallettxes=<mode> -> setting -rescan=1\n", __func__);
|
||||
if (gArgs.SoftSetBoolArg("-rescan", true)) {
|
||||
LogPrintf("%s: parameter interaction: -zapwallettxes=<mode> -> setting -rescan=1\n", __func__);
|
||||
}
|
||||
}
|
||||
|
||||
if (is_multiwallet) {
|
||||
|
Loading…
Reference in New Issue
Block a user