Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuring custom Bitcoin node in GUI settings by IPv6 address fails #3990

Closed
wiz opened this issue Feb 19, 2020 · 2 comments · Fixed by #4045
Closed

Configuring custom Bitcoin node in GUI settings by IPv6 address fails #3990

wiz opened this issue Feb 19, 2020 · 2 comments · Fixed by #4045
Labels
a:bug is:critical https://bisq.wiki/Critical_bug is:priority PR or issue marked with this label is up for compensation

Comments

@wiz
Copy link
Member

wiz commented Feb 19, 2020

Description

The GUI settings fail to configure btcnodes by IPv6 address. However, passing an IPv6 address for the btcnode works fine when passed as a command line option.

Version

v1.2.7

Steps to reproduce

  1. Settings
  2. Network Info
  3. Uncheck "Use Tor for Bitcoin network"
  4. Check "Use custom Bitcoin nodes"
  5. Enter "[2401:b140::42:100]:8333" in the "Custom Bitcoin Nodes" field
  6. Restart Bisq

Expected behaviour

Bisq should connect to the configured Bitcoin node over IPv6

Actual behaviour

Bisq loads random Bitcoin nodes from the public network

Additional info

Setting Bitcoin nodes by IPv6 works fine using command line option --btcNodes=[2401:b140::42:100]:8333

@ripcurlx ripcurlx added a:bug is:priority PR or issue marked with this label is up for compensation is:critical https://bisq.wiki/Critical_bug labels Feb 19, 2020
@ghost
Copy link

ghost commented Mar 8, 2020

The comma separated IP addresses from --btcNodes configuration are being parsed by the following routine, which is failing for IPv6:

    public static BtcNode fromFullAddress(String fullAddress) {
        String[] parts = fullAddress.split(":");
        checkArgument(parts.length > 0);
        final String host = parts[0];
        int port = DEFAULT_PORT;
        if (parts.length == 2)
            port = Integer.valueOf(parts[1]);

        return host.contains(".onion") ? new BtcNode(null, host, null, port, null) : new BtcNode(null, null, host, port, null);
    }

The code expects a colon separating address from port so the address above evaluates to [2401 and port evaluates to 8333 from DEFAULT_PORT.

Having discussed with @wiz, there's another scenario to look into which is rpcHost configuration that does accept IPv6. I'll look into that an see how it's parsing IPv6 addresses.

Please consider me to be working on a PR for this.

@wiz
Copy link
Member Author

wiz commented Mar 8, 2020

Ah yes you are right, while RPC host and Block Notification host both work with IPv6 the Bitcoin P2P host does not allow IPv6 due to the code you pasted above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:bug is:critical https://bisq.wiki/Critical_bug is:priority PR or issue marked with this label is up for compensation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants