diff options
author | John Newbery <john@johnnewbery.com> | 2018-04-19 11:07:54 -0400 |
---|---|---|
committer | John Newbery <john@johnnewbery.com> | 2018-04-19 11:07:54 -0400 |
commit | 3476e3c48b34034cefb7058b3f8ea9d13296f5f0 (patch) | |
tree | 7d389dc5c74058f3d389ec50304347dfcbc2f706 | |
parent | c19986940869034cb15e684f014f48fe00e75778 (diff) |
[wallet] Fix zapwallettxes/multiwallet interaction.
-zapwallettxes should be disallowed when starting bitcoin in multiwallet
mode.
-rw-r--r-- | src/wallet/init.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/wallet/init.cpp b/src/wallet/init.cpp index 2fd9aa1a6f..accfd6e149 100644 --- a/src/wallet/init.cpp +++ b/src/wallet/init.cpp @@ -118,19 +118,19 @@ bool WalletInit::ParameterInteraction() const } } - int zapwallettxes = gArgs.GetArg("-zapwallettxes", 0); + bool zapwallettxes = gArgs.GetBoolArg("-zapwallettxes", false); // -zapwallettxes implies dropping the mempool on startup - if (zapwallettxes != 0 && gArgs.SoftSetBoolArg("-persistmempool", false)) { - LogPrintf("%s: parameter interaction: -zapwallettxes=%s -> setting -persistmempool=0\n", __func__, zapwallettxes); + if (zapwallettxes && gArgs.SoftSetBoolArg("-persistmempool", false)) { + LogPrintf("%s: parameter interaction: -zapwallettxes enabled -> setting -persistmempool=0\n", __func__); } // -zapwallettxes implies a rescan - if (zapwallettxes != 0) { + if (zapwallettxes) { if (is_multiwallet) { return InitError(strprintf("%s is only allowed with a single wallet file", "-zapwallettxes")); } if (gArgs.SoftSetBoolArg("-rescan", true)) { - LogPrintf("%s: parameter interaction: -zapwallettxes=%s -> setting -rescan=1\n", __func__, zapwallettxes); + LogPrintf("%s: parameter interaction: -zapwallettxes enabled -> setting -rescan=1\n", __func__); } } |