Skip to content

-torcontrol does not resolve a hostname if it is given #22236

@jrawsthorne

Description

@jrawsthorne

Expected behavior

-torcontrol should try to resolve a hostname if it is given

Actual behavior

The hostname is passed as an ip so the connection fails

2021-06-13T20:35:54Z tor: Error parsing socket address mynode.local:9051
2021-06-13T20:35:54Z tor: Initiating connection to Tor control port mynode.local:9051 failed

To reproduce

Add 127.0.0.1 mynode to /etc/hosts and pass -torcontrol=mynode:9051 as an argument. The connection fails. Try with -torcontrol=127.0.0.1:9051 and it works.

System information

Bitcoin Core 0.21.1 from https://bitcoincore.org/bin/bitcoin-core-0.21.1/bitcoin-0.21.1-x86_64-linux-gnu.tar.gz
Ubuntu 18.04

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions