Skip to content

Commit 006c503

Browse files
jnewberyfurszy
authored andcommitted
[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.
1 parent c6d45c6 commit 006c503

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/init.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -909,6 +909,11 @@ void InitParameterInteraction()
909909
LogPrintf("%s : parameter interaction: -salvagewallet=1 -> setting -rescan=1\n", __func__);
910910
}
911911

912+
// -zapwallettx implies dropping the mempool on startup
913+
if (gArgs.GetBoolArg("-zapwallettxes", false) && gArgs.SoftSetBoolArg("-persistmempool", false)) {
914+
LogPrintf("%s: parameter interaction: -zapwallettxes=<mode> -> setting -persistmempool=0\n", __func__);
915+
}
916+
912917
// -zapwallettx implies a rescan
913918
if (gArgs.GetBoolArg("-zapwallettxes", false)) {
914919
if (gArgs.SoftSetBoolArg("-rescan", true))

0 commit comments

Comments
 (0)