aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlex Morcos <morcos@chaincode.com>2017-07-13 13:48:28 -0400
committerAlex Morcos <morcos@chaincode.com>2017-07-13 13:48:28 -0400
commitdd97a529ad23169f346aa042a808adf702ce8450 (patch)
treea913c2289a8588f73dff19b1da9259596bee3145 /src
parent7666250ffb4e8fc5c98556e2c8e121c72d6fe54c (diff)
downloadbitcoin-dd97a529ad23169f346aa042a808adf702ce8450.tar.xz
Properly forbid -salvagewallet and -zapwallettxes for multi wallet.
Diffstat (limited to 'src')
-rw-r--r--src/wallet/wallet.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp
index 5e9701c71c..07b7f58a64 100644
--- a/src/wallet/wallet.cpp
+++ b/src/wallet/wallet.cpp
@@ -4033,20 +4033,24 @@ bool CWallet::ParameterInteraction()
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) {
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 (SoftSetBoolArg("-rescan", true)) {
+ LogPrintf("%s: parameter interaction: -salvagewallet=1 -> setting -rescan=1\n", __func__);
+ }
}
// -zapwallettx implies a rescan
- if (GetBoolArg("-zapwallettxes", false) && SoftSetBoolArg("-rescan", true)) {
+ if (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 (SoftSetBoolArg("-rescan", true)) {
+ LogPrintf("%s: parameter interaction: -zapwallettxes=<mode> -> setting -rescan=1\n", __func__);
+ }
}
if (is_multiwallet) {