Skip to content

Commit 3476e3c

Browse files
committed
[wallet] Fix zapwallettxes/multiwallet interaction.
-zapwallettxes should be disallowed when starting bitcoin in multiwallet mode.
1 parent c199869 commit 3476e3c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/wallet/init.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,19 +118,19 @@ bool WalletInit::ParameterInteraction() const
118118
}
119119
}
120120

121-
int zapwallettxes = gArgs.GetArg("-zapwallettxes", 0);
121+
bool zapwallettxes = gArgs.GetBoolArg("-zapwallettxes", false);
122122
// -zapwallettxes implies dropping the mempool on startup
123-
if (zapwallettxes != 0 && gArgs.SoftSetBoolArg("-persistmempool", false)) {
124-
LogPrintf("%s: parameter interaction: -zapwallettxes=%s -> setting -persistmempool=0\n", __func__, zapwallettxes);
123+
if (zapwallettxes && gArgs.SoftSetBoolArg("-persistmempool", false)) {
124+
LogPrintf("%s: parameter interaction: -zapwallettxes enabled -> setting -persistmempool=0\n", __func__);
125125
}
126126

127127
// -zapwallettxes implies a rescan
128-
if (zapwallettxes != 0) {
128+
if (zapwallettxes) {
129129
if (is_multiwallet) {
130130
return InitError(strprintf("%s is only allowed with a single wallet file", "-zapwallettxes"));
131131
}
132132
if (gArgs.SoftSetBoolArg("-rescan", true)) {
133-
LogPrintf("%s: parameter interaction: -zapwallettxes=%s -> setting -rescan=1\n", __func__, zapwallettxes);
133+
LogPrintf("%s: parameter interaction: -zapwallettxes enabled -> setting -rescan=1\n", __func__);
134134
}
135135
}
136136

0 commit comments

Comments
 (0)