This PR adds ability to label incoming Tor connections as different from normal localhost connections.
Default onion service target ports are:
- 8334 on mainnnet
- 18334 on testnet
- 38334 on signet
- 18445 on regtest
To set the onion service target socket manually the extended -bind config option could be used:
0$ src/bitcoind -help | grep -A 6 -e '-bind'
1  -bind=<addr>[:<port>][=onion]
2       Bind to given address and always listen on it (default: 0.0.0.0). Use
3       [host]:port notation for IPv6. Append =onion to tag any incoming
4       connections to that address and port as incoming Tor connections
5       (default: 127.0.0.1:8334=onion, testnet: 127.0.0.1:18334=onion,
6       signet: 127.0.0.1:38334=onion, regtest: 127.0.0.1:18445=onion)
Since pr19991.02 update this PR is an alternative to #19043.