Browse Source

Properly forbid -salvagewallet and -zapwallettxes for multi wallet.

0.15
Alex Morcos 7 years ago
parent
commit
dd97a529ad
  1. 8
      src/wallet/wallet.cpp

8
src/wallet/wallet.cpp

@ -4033,21 +4033,25 @@ bool CWallet::ParameterInteraction()
LogPrintf("%s: parameter interaction: -blocksonly=1 -> setting -walletbroadcast=0\n", __func__); LogPrintf("%s: parameter interaction: -blocksonly=1 -> setting -walletbroadcast=0\n", __func__);
} }
if (GetBoolArg("-salvagewallet", false) && SoftSetBoolArg("-rescan", true)) { if (GetBoolArg("-salvagewallet", false)) {
if (is_multiwallet) { if (is_multiwallet) {
return InitError(strprintf("%s is only allowed with a single wallet file", "-salvagewallet")); return InitError(strprintf("%s is only allowed with a single wallet file", "-salvagewallet"));
} }
// Rewrite just private keys: rescan to find transactions // Rewrite just private keys: rescan to find transactions
if (SoftSetBoolArg("-rescan", true)) {
LogPrintf("%s: parameter interaction: -salvagewallet=1 -> setting -rescan=1\n", __func__); LogPrintf("%s: parameter interaction: -salvagewallet=1 -> setting -rescan=1\n", __func__);
} }
}
// -zapwallettx implies a rescan // -zapwallettx implies a rescan
if (GetBoolArg("-zapwallettxes", false) && SoftSetBoolArg("-rescan", true)) { if (GetBoolArg("-zapwallettxes", false)) {
if (is_multiwallet) { if (is_multiwallet) {
return InitError(strprintf("%s is only allowed with a single wallet file", "-zapwallettxes")); return InitError(strprintf("%s is only allowed with a single wallet file", "-zapwallettxes"));
} }
if (SoftSetBoolArg("-rescan", true)) {
LogPrintf("%s: parameter interaction: -zapwallettxes=<mode> -> setting -rescan=1\n", __func__); LogPrintf("%s: parameter interaction: -zapwallettxes=<mode> -> setting -rescan=1\n", __func__);
} }
}
if (is_multiwallet) { if (is_multiwallet) {
if (GetBoolArg("-upgradewallet", false)) { if (GetBoolArg("-upgradewallet", false)) {

Loading…
Cancel
Save