Skip to content

Commit

Permalink
[wallet] fix zapwallettxes interaction with persistent mempool
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jnewbery authored and furszy committed Jan 18, 2021
1 parent c6d45c6 commit 006c503
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -909,6 +909,11 @@ void InitParameterInteraction()
LogPrintf("%s : parameter interaction: -salvagewallet=1 -> setting -rescan=1\n", __func__);
}

// -zapwallettx implies dropping the mempool on startup
if (gArgs.GetBoolArg("-zapwallettxes", false) && gArgs.SoftSetBoolArg("-persistmempool", false)) {
LogPrintf("%s: parameter interaction: -zapwallettxes=<mode> -> setting -persistmempool=0\n", __func__);
}

// -zapwallettx implies a rescan
if (gArgs.GetBoolArg("-zapwallettxes", false)) {
if (gArgs.SoftSetBoolArg("-rescan", true))
Expand Down

0 comments on commit 006c503

Please sign in to comment.