diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index fe0f7dc43e66c..9e9adb00d5b46 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -658,12 +658,14 @@ bool CWallet::ParameterInteraction() gArgs.SoftSetArg("-wallet", DEFAULT_WALLET_DAT); const bool is_multiwallet = gArgs.GetArgs("-wallet").size() > 1; - if (gArgs.GetBoolArg("-salvagewallet", false) && gArgs.SoftSetBoolArg("-rescan", true)) { + if (gArgs.GetBoolArg("-salvagewallet", false)) { if (is_multiwallet) { return UIError(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__); + } } int zapwallettxes = gArgs.GetArg("-zapwallettxes", 0); @@ -673,11 +675,13 @@ bool CWallet::ParameterInteraction() } // -zapwallettxes implies a rescan - if (zapwallettxes != 0 && gArgs.SoftSetBoolArg("-rescan", true)) { + if (zapwallettxes != 0) { if (is_multiwallet) { return UIError(strprintf(_("%s is only allowed with a single wallet file"), "-zapwallettxes")); } - LogPrintf("%s: parameter interaction: -zapwallettxes= -> setting -rescan=1\n", __func__); + if (gArgs.SoftSetBoolArg("-rescan", true)) { + LogPrintf("%s: parameter interaction: -zapwallettxes= -> setting -rescan=1\n", __func__); + } } if (is_multiwallet) {