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.
This PR also fixes the zapwallettxes.py functional test, which did not properly test this feature. The test line:
0 assert_raises(JSONRPCException, self.nodes[0].gettransaction, [txid3])
1 #there must be a expection because the unconfirmed wallettx0 must be gone by now
is not actually testing the presence of the transaction since the RPC is being called incorrectly (with an array instead of a string). The assert_raises()
passes since an assert is raised, but it’s not the one the test writer had in mind!
Fixes #9710 .