Normally ConnectNode() would choose whether to use a proxy and which one. Make it possible to override this from the callers and same for OpenNetworkConnection() - pass down the proxy to ConnectNode().
Document both functions.
This is useful if we want to open connections to IPv4 or IPv6 peers through the Tor SOCKS5 proxy.
Also have OpenNetworkConnection() return whether the connection succeeded or not. This can be used when the caller needs to keep track of how many (successful) connections were opened.
This is part of #29415 Broadcast own transactions only via short-lived Tor or I2P connections. Putting it in its own PR to reduce the size of #29415 and because it does not depend on the other commits from there.