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



Summary:

Anton Shevchenko posted on the Bitcoin development mailing list regarding an unexpected behavior when using the -proxy setting with bitcoind. The -proxy option is used to connect to a SOCKS5 proxy that can access an internal network. When bitcoind is started with the -noconnect option, there is no network activity as expected. However, when Anton commands bitcoin-cli to connect to a node with a specific address, bitcoind attempts to connect without using the proxy, instead of initiating the connection through the proxy as expected.In the code, CConnman::ConnectNode calls GetProxy, and GetProxy returns false because CNetAddr::GetNetwork returns NET_UNROUTABLE. Anton argues that this is unexpected behavior at minimum and should be documented. He suggests introducing another option for unroutable addresses: connect locally (for compatibility reasons, default); connect through a proxy; or don't connect to unroutable addresses.Anton also raised an issue on GitHub regarding this implementation issue.


Updated on: 2023-05-22T20:47:08.228193+00:00