[mempool] sanity check that all unbroadcast txns are in mempool
Summary:
- before reattempting broadcast for unbroadcast txns, check they are in mempool and remove if not
- this protects from memory leaks and network spam just in case unbroadcast set (incorrectly) has extra txns
- check that tx is in mempool before adding to unbroadcast set to try to prevent this from happening
This is a backport of Core PR18895 [3/3]
https://github.com/bitcoin/bitcoin/pull/18895/commits/9d3f7eb9860254eb787ebe2734fd6a26bcf365c1
Depends on D9024
Test Plan: ninja all check-all
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D9025