bitcoind -proxy=host:port doesn't work for unroutable network



Summary:

The author of the context is reporting unexpected behavior when running bitcoind with the -proxy setting. This is used to connect to a SOCKS5 proxy that can access an internal network. Bitcoind is started with the -noconnect option and there is no network activity, as intended. However, when the author commands bitcoin-cli to connect to a node with a specific address, bitcoind attempts to connect without using the proxy. Upon reviewing the code, it appears that the CConnman::ConnectNode function calls GetProxy, which returns false because CNetAddr::GetNetwork returns NET_UNROUTABLE. The author believes this is unexpected behavior and should be documented. They suggest introducing another option for unroutable addresses: connect locally (for compatibility reasons, default), connect through the proxy, or don't connect at all.


Updated on: 2023-05-22T20:46:50.068820+00:00