-zapwallettxes
is known to not work with multiwallet and is currently disabled if multiple wallets are being loaded.
This PR removes the -zapwallettxes
startup option and replaces its functionality with a zapwallettxes
RPC command. This RPC does almost the same thing that the startup command did in that it removes all of the transactions from the target wallet. A blockchain rescan can optionally be triggered, as well as a mempool rescan. The default is to rescan the blockchain but not the mempool.
However a large difference is that -zapwallettxes
would prevent the mempool from being loaded (#10330) but the RPC does not clear the mempool. However this does mean that the usefulness of this is questionable as the unconfirmed transactions that are being removed from the wallet would still appear in the mempool. The original behavior can be replicated by doing zapwallettxes
and restarting with -persistmempool=0
.
Also tests are updated to use the new RPC.