- During self advertisement in
GetLocalAddrFromPeer- we advertise the "IP address we think we are" and sometimes replace it with what "IP address the peer thinks we are". - when an outbound connections is made to a peer via a proxy, the "IP address the peer thinks we are" is the proxy's ip address.
- so the proxy's ip address can get relayed as our self advertisement
- in normal cases the proxy's ip address is not a reachable inbound address and shouldn't be relayed on the network.
Example: when a node running both Tor and clearnet via a SOCKS5 proxy connects to a clearnet peer (proxy=127.0.0.1:9050, listen=1, discover=1 (or) onion=127.0.0.1:9050), the "IP address the peer thinks we are" is the Tor exit node's IP address and doesn't make sense to relay it. 55-76% of all tor exit nodes were present in various addrman snapshots I checked (my node and the ones from b10c’s peer.observer) from now and few years ago. would be nice to not unnecessarily relay these tor exit IPs since they end up being stored as fresh and gossiped from multiple sources entries in our addrman.
an advanced node runner might have a proxy whose ip address is also a reachable inbound address. I've personally not used such a proxy but 1 difference for them is that they'd need to explicitly set -externalip=<addr> to self-advertise their proxy address. i feel it’s an acceptable tradeoff and would imagine they are already using -externalip=<addr> config flag as they are explicitly managing their node's public address.