Use the spent outpoint multimap to figure out which wallet transaction outputs are unspent, instead of a vfSpent array that is saved to disk.
This is simpler and more robust and will result in smaller wallet.dat files.
Careful review and testing needed. In particular, I have not (yet) tested importing private keys that were used in the past or that were involved in a mutated transaction scenario.
There might also be an issue with taking a wallet.dat file produced with this change (which does not write vfSpent) and using it with an older version, although I think the old ReacceptWalletTransactions() code will behave reasonably in that case and will automatically recompute vfSpent.
I also have not tested for performance with a very large wallet (a wallet containing a very large number of transactions); I expect somebody running a service who HAS a very large wallet to step up and do that– ideally by writing a new qa/rpc-tests/largewallet.sh regression test that creates and tests a large -regtest wallet.
Motivation for this change: it fixes an edge case where transaction malleability results in spendable coins incorrectly being marked as unspendable.