From e7a2181b49774f2cc29839ebbdc206bcdb715a7f Mon Sep 17 00:00:00 2001 From: John Newbery Date: Wed, 3 May 2017 13:36:13 -0400 Subject: [wallet] fix zapwallettxes interaction with persistent mempool zapwallettxes previously did not interact well with persistent mempool. zapwallettxes would cause wallet transactions to be zapped, but they would then be reloaded from the mempool on startup. This commit softsets persistmempool to false if zapwallettxes is enabled so transactions are actually zapped. --- src/wallet/wallet.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/wallet') diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 07b7f58a64..4366428f5c 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -4043,6 +4043,11 @@ bool CWallet::ParameterInteraction() } } + // -zapwallettx implies dropping the mempool on startup + if (GetBoolArg("-zapwallettxes", false) && SoftSetBoolArg("-persistmempool", false)) { + LogPrintf("%s: parameter interaction: -zapwallettxes= -> setting -persistmempool=0\n", __func__); + } + // -zapwallettx implies a rescan if (GetBoolArg("-zapwallettxes", false)) { if (is_multiwallet) { -- cgit v1.2.3 From 4c3b538c61532dc68d79bbe34729759a13b73f0c Mon Sep 17 00:00:00 2001 From: John Newbery Date: Fri, 14 Jul 2017 18:17:27 -0400 Subject: [logs] fix zapwallettxes startup logs --- src/wallet/wallet.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/wallet') diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 4366428f5c..7aa2e31743 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -4043,18 +4043,19 @@ bool CWallet::ParameterInteraction() } } - // -zapwallettx implies dropping the mempool on startup - if (GetBoolArg("-zapwallettxes", false) && SoftSetBoolArg("-persistmempool", false)) { - LogPrintf("%s: parameter interaction: -zapwallettxes= -> setting -persistmempool=0\n", __func__); + int zapwallettxes = GetArg("-zapwallettxes", 0); + // -zapwallettxes implies dropping the mempool on startup + if (zapwallettxes != 0 && SoftSetBoolArg("-persistmempool", false)) { + LogPrintf("%s: parameter interaction: -zapwallettxes=%s -> setting -persistmempool=0\n", __func__, zapwallettxes); } - // -zapwallettx implies a rescan - if (GetBoolArg("-zapwallettxes", false)) { + // -zapwallettxes implies a rescan + if (zapwallettxes != 0) { if (is_multiwallet) { return InitError(strprintf("%s is only allowed with a single wallet file", "-zapwallettxes")); } if (SoftSetBoolArg("-rescan", true)) { - LogPrintf("%s: parameter interaction: -zapwallettxes= -> setting -rescan=1\n", __func__); + LogPrintf("%s: parameter interaction: -zapwallettxes=%s -> setting -rescan=1\n", __func__, zapwallettxes); } } -- cgit v1.2.3