I was looking into why my node was frequently opening new block-relay-only connections even though it already had two such nodes connected, and while this appears to be intended behavior to counter eclipse attacks, while searching the codebase for this I encountered a minor contradiction in the docs.
Specifically, doc/reduce-memory.md says:
- `-maxconnections=<n>` - the maximum number of connections, which defaults to 125. Each active connection takes up some
memory. This option applies only if inbound connections are enabled; otherwise, the number of connections will not
be more than 11. Of the 11 outbound peers, there can be 8 full-relay connections, 2 block-relay-only ones,
and occasionally 1 short-lived feeler or extra outbound block-relay-only connection.
While doc/reduce-traffic.md says:
By default, Bitcoin Core allows up to 125 connections to different peers, 10 of
which are outbound. You can therefore, have at most 115 inbound connections.
Of the 10 outbound peers, there can be 8 full-relay connections and 2
block-relay-only ones.
I'm not sure if the extra feeler/block-relay-only connection takes up one of the maxconnections slots or not, but the latter should probably be updated to reflect this behavior.