Picks up #28538
Outbound-full-relay slots should be used by peers that actually relay transactions, besides #28538 see #16418 and #28371 for the motivation. So try to replace peers that are not relaying txs with peers that do.
The approach differs from the original PR in a few details in response to some of the review comments there:
- A replacement is connected before the peer is evicted. The original PR disconnected a non-tx-relaying peer once all full outbound slots were filled. Reviewers preferred having a replacement available first (https://github.com/bitcoin/bitcoin/pull/28538#issuecomment-1883481846). Now an extra outbound-full-relay connection is requested, like the extra network-specific peers, and the existing eviction of extra outbound peers prefers peers that don't relay txs.
- Peers not relaying txs don't get
m_protect. Otherwise they could stay forever (https://github.com/bitcoin/bitcoin/pull/28538#discussion_r1443336121), and ignoring the protection was rejected in the same thread (https://github.com/bitcoin/bitcoin/pull/28538#discussion_r1443312604). - An only peer on a network is not replaced. Otherwise the network-specific extra connections and this logic would keep replacing each other (https://github.com/bitcoin/bitcoin/pull/28538#issuecomment-1883481846). This also covers the
-maxconnections=1case (https://github.com/bitcoin/bitcoin/pull/28538#discussion_r1417178196).
Nothing is changed in -blocksonly mode or during IBD. The rename commit and the functional test are taken from the original PR with some changes to match the new behavior.