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

Use InetAddress.getLoopbackAddress instead of InetAddress.getLocalHost() #4466

Merged

Conversation

chimp1984
Copy link
Contributor

On OSX InetAddress.getLocalHost() can cause problems. On my machine I
get a 5 sec. delay at each start up in localhost mode. The
InetAddress.getLoopbackAddress call is super fast.

Both versions connect to my local btc node, but not sure what can be
the differences if local environment is configured differently as
default. But as those issues with very slow getLocalHost lookup seems
to be more risky I would recommend that we change it.

It only affects localhost regtest mode and users who have a local btc
node running. The detection code for that is using getLoopbackAddress
as well.
See: a5cca0e

On OSX InetAddress.getLocalHost() can cause problems. On my machine I
get a 5 sec. delay at each start up in localhost mode. The
InetAddress.getLoopbackAddress call is super fast.

Both versions connect to my local btc node, but not sure what can be
the differences if local environment is configured differently as
default. But as those issues with very slow getLocalHost lookup seems
to be more risky I would recommend that we change it.

It only affects localhost regtest mode and users who have a local btc
node running. The detection code for that is using getLoopbackAddress
as well.
See: bisq-network@a5cca0e
@Emzy
Copy link
Contributor

Emzy commented Sep 3, 2020

I would advice to always use 127.0.0.1 to connect to local running services.
No need to use a physical interface IP address.

@chimp1984
Copy link
Contributor Author

Thanks @Emzy . Then the getLoopbackAddress is the right approach. Was also changed to that in the local node detection code.

Copy link
Member

@ripcurlx ripcurlx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

@ripcurlx ripcurlx merged commit 254b1f1 into bisq-network:master Sep 3, 2020
@chimp1984 chimp1984 deleted the change-localhost-to-loopback branch September 3, 2020 18:12
@ripcurlx ripcurlx added this to the v1.3.8 milestone Sep 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants