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

Avoid startup failure when bannedSeedNodes arg is empty #4104

Merged
merged 1 commit into from
Mar 31, 2020

Conversation

cbeams
Copy link
Member

@cbeams cbeams commented Mar 31, 2020

This commit fixes #4103, where it was demonstrated that a
bisq.properties file containing the following entries would cause Bisq
to fail at startup:

baseCurrencyNetwork=BTC_MAINNET
bannedSeedNodes=
bannedBtcNodes=
bannedPriceRelayNodes=5bmpx76qllutpcyp

The source of the problem was that the jOptSimple argument parsing
library converts the empty value of bannedSeedNodes to a List of
size 1 where the 0th element of the list is an empty string. This empty
string was then attempted to be converted into a new NodeAddress,
causing a validation error. This conversion happened during Guice
wiring, and manifested as a blank white screen appearing as wiring
errors often do in Bisq.

The fix is simple and surgical. We now filter out any empty string
elements before attempting to convert the banned seed node value to a
new node address. I have reviewed the other related options, such as
bannedPriceRelayNodes and bannedBtcNodes, and they do not cause the
problem described above, so no filtering or other changes have been made
to the way they work.

Fixes #replaceWithIssueNr, fixes #replaceWithIssueNr

Your PR description here.

@cbeams cbeams self-assigned this Mar 31, 2020
This commit fixes bisq-network#4103, where it was demonstrated that a
bisq.properties file containing the following entries would cause Bisq
to fail at startup:

    baseCurrencyNetwork=BTC_MAINNET
    bannedSeedNodes=
    bannedBtcNodes=
    bannedPriceRelayNodes=5bmpx76qllutpcyp

The source of the problem was that the jOptSimple argument parsing
library converts the empty value of bannedSeedNodes to a List<String> of
size 1 where the 0th element of the list is an empty string. This empty
string was then attempted to be converted into a new NodeAddress,
causing a validation error. This conversion happened during Guice
wiring, and manifested as a blank white screen appearing as wiring
errors often do in Bisq.

The fix is simple and surgical. We now filter out any empty string
elements before attempting to convert the banned seed node value to a
new node address. I have reviewed the other related options, such as
bannedPriceRelayNodes and bannedBtcNodes, and they do not cause the
problem described above, so no filtering or other changes have been made
to the way they work.
Copy link
Contributor

@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.

ACK

Solves my problem as described in #4103. Thanks for the fix!

@ripcurlx ripcurlx merged commit 13604b6 into bisq-network:master Mar 31, 2020
@ripcurlx ripcurlx added this to the v1.3.0 milestone Apr 1, 2020
@ripcurlx ripcurlx added the is:priority PR or issue marked with this label is up for compensation label Apr 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
is:priority PR or issue marked with this label is up for compensation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Broken bisq.properties file prevents Bisq to start
2 participants