Currently, setting up a proxy (whether SOCKS5 or Tor) with an IPv6 address works correctly via the command line or configuration file in both bitcoind and bitcoin-qt (also from the UI the ipv6 address gets saved properly in settings.json). However, the UI does not reflect this properly, which can create confusion. Since some ISPs and VPNs still experience issues with IPv6, users may mistakenly think there is a problem with Bitcoin Core, when in fact the proxy setup is functioning as expected.
So this PR ensures that the proxy IP is displayed correctly in the UI when using an IPv6 address.
No functionality impact; changes only affect UI display.
<details> <summary>Click her to see <b>before</b> and <b>after</b> screenshots.</summary>
Before:
After:
</details>
<details> <summary>Test instructions</summary>
(Ubuntu 22.04)
Start ssh service on localhost.
ssh -D [::1]:1080 -f -C -q -N localhostCheck that the service is up and running.
ps aux | grep ssh pepe 2860289 0.0 0.0 20456 5576 ? Ss 06:59 0:00 ssh -D [::1]:1080 -f -C -q -N localhostCheck with
bitcoindif it works correctly.bitcoind -onlynet=ipv6 -proxy=[::1]:1080Check for established connections.
netstat -natl |grep 1080 tcp6 0 0 ::1:1080 :::* LISTEN tcp6 0 0 ::1:47610 ::1:1080 ESTABLISHED tcp6 0 0 ::1:1080 ::1:47610 ESTABLISHED tcp6 0 0 ::1:1080 ::1:47606 TIME_WAIT[ { "id": 0, "addr": "[2a01:4f9:4a:2a07::2]:8333", "addrbind": "[::1]:47638", "network": "ipv6", ...Stop
bitcoindand runbitcoin-qtadding the corresponding configuration insettings.json.{ "onlynet": "ipv6", "proxy": "[::1]:1080", }Open the Peers window to check available connections or run
getpeerinfoon the rpc-console window.Same can be done for Tor setting up
torservice (I'll add instructions later) and configuring on its default port 9050 and forcing"onlynet": "onion"to verify easily the net traffic.
</details>
Thanks jarolrod and vasild for your help on validating ipv6 was not broken.