If a wallet transaction gets evicted from the mempool (through maxmempool or similar ways of eviction like a bitcoind restart), the particular transaction was marked as conflicted (confirmations = -1) and the inputs can be spent again.
This PR enabled detection of conflicted transactions by actually checking the mempool and the utxo set. The “conflicted” flag is cached in memory and re-checked during a block tip update.
The check could be further improved:
0[10:51:21] <sipa> or even cache the blockindex itself, and as long as the active one descends from it, don't reevaluate if true