https://github.com/bitcoin/bitcoin/pull/28538

Motivation

This PR tries to fix https://github.com/bitcoin/bitcoin/issues/16418 https://github.com/bitcoin/bitcoin/issues/28371

Currently, it is possible that we have an insufficient amount of outbound peers relaying our transactions (as in << 8). This can happen for two main reasons:

  1. There is no check being made to ensure that out outbound connections are not -block-only, so it could be the case that some of out peers simply do not forward our tx data (this counting the two block-relay-only connections, which are purposely like this).
  2. It could be the case that some of out outbound connection peers have a substantially smaller mempool than usual with a high minfeefilter, resulting in our transactions being simply dropped

Furthermore, if less peers are relaying our transactions it is easier for network observers to infer the origin or a transaction (as the node IP), given there is less noise in the flooding of this data to the network (there are less nodes initially broadcasting the data so it is easier to correlate the first announcer to the origin).

This PR is trying to fix the first described point.

Review

p2p: attempt to fill full outbound connection slots with peers that support tx relay by mzumsande · Pull Request #28538 · bitcoin/bitcoin