Walletwasabi: [Bug] Invalid Host for torv3

Created on 4 Jul 2019  路  5Comments  路  Source: zkSNACKs/WalletWasabi

General Description

image

How To Reproduce?

Put a Torv3 onion link.

This work on the latest release, not on master.

debug priority

All 5 comments

public string ValidateHost(string host)
        {
            if (string.IsNullOrWhiteSpace(host))
            {
                return string.Empty;
            }

            var theHost = host.Trim();
            if (Uri.TryCreate(theHost, UriKind.Absolute, out _))
            {
                return string.Empty;
            }
            if (IPAddress.TryParse(theHost, out var ip))
            {
                if (ip.AddressFamily == AddressFamily.InterNetworkV6 && !Socket.OSSupportsIPv6)
                {
                    return "OS does not support IPv6 addresses.";
                }
                return string.Empty;
            }

            return "Invalid host.";
        }

This is wrong. This can't be an URL.

Ok you are complicating the logic way too much... will fix this.

Aaah, there were so many pull request and issues on hold I didn't get to this one. Fixing this should've go into the release.

I added the support of bitcoin-p2p uri, this is used in green wallet, knots and btcpay

Was this page helpful?
0 / 5 - 0 ratings

Related issues

davterra picture davterra  路  3Comments

yahiheb picture yahiheb  路  3Comments

trading2835 picture trading2835  路  3Comments

molnard picture molnard  路  3Comments

yahiheb picture yahiheb  路  3Comments