diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2017-07-14 19:01:17 -0700 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2017-07-14 19:07:42 -0700 |
commit | 1c011ff430106b5f727f2eaa0f7f4883cd2122a3 (patch) | |
tree | 84b012b1b90aea4c7f5f61655ea40bb9c337e4a2 | |
parent | ec8a50b8d786a8cd1192e692ab19b46979add582 (diff) | |
parent | dd97a529ad23169f346aa042a808adf702ce8450 (diff) |
Merge #10816: Properly forbid -salvagewallet and -zapwallettxes for multi wallet.
dd97a529a Properly forbid -salvagewallet and -zapwallettxes for multi wallet. (Alex Morcos)
Tree-SHA512: dcde8f854ae957b4d3af4bcf1b811e0b6e9b93602764f86499e46a28d304cd4ee93ba058c03f6ca74ccb60e1310c83e53b698c64d93e5503115377655b80d44d
-rw-r--r-- | src/wallet/wallet.cpp | 12 |
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) { |