> In order to determine whether to download or process a relayed transaction, we> try to determine if we already have the transaction, either in the mempool, in
> our recently rejected filter, in our orphan pool, or already confirmed in the
> chain itself.
>
> Prior to this commit, the heuristic for checking the chain is based on whether
> there's an output corresponding to the 0- or 1-index vout in our coin cache.
> While that is a quick check, it is very imprecise (say if those outputs were
> already spent in a block) -- we can do better by just keeping a rolling bloom
> filter of the transactions in recent blocks, which will capture the case of a
> transaction which has been confirmed and then fully spent already.
>
> To avoid relay problems for transactions which have been included in a recent
> block but then reorged out of the chain, we clear the bloom filter whenever a
> block is disconnected.
This is a backport of [[https://github.com/bitcoin/bitcoin/pull/17951 | PR17951]]