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

config: Parse network interfaces. #1514

Merged
merged 1 commit into from
Mar 29, 2019
Merged

Conversation

dnldd
Copy link
Member

@dnldd dnldd commented Nov 5, 2018

This adds config helpers for parsing network interface states based on the config parameters set.
Work towards getnetworkinfo implementation.

@dnldd dnldd closed this Nov 5, 2018
@dnldd dnldd reopened this Nov 5, 2018
@dnldd dnldd force-pushed the network_info branch 2 times, most recently from 6457c14 to 5818873 Compare November 5, 2018 20:00
config.go Outdated Show resolved Hide resolved
@dnldd dnldd force-pushed the network_info branch 2 times, most recently from ba441e3 to ef36291 Compare November 13, 2018 23:25
@davecgh davecgh added this to the 1.4.0 milestone Nov 14, 2018
@dnldd dnldd force-pushed the network_info branch 2 times, most recently from 030b766 to 939e808 Compare November 27, 2018 10:30
This adds config helpers for parsing network interface
states based on the config parameters set. Work towards getnetworkinfo implementation.
Copy link
Member

@davecgh davecgh left a comment

Choose a reason for hiding this comment

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

I'm going to go ahead and accept this since it appears correct for the time being, but is pretty dangerous code because it is making assumptions that will be very easy to accidentally break and has a ton of unnecessary error handling and conditionals.

This could be accomplished much safer and easier to read fashion by merely defining the supported networks as variables of type dcrjson.NetworksResult and setting the fields directly depending on the parsed results. I'll push a separate PR which cleans this up shortly.

@davecgh davecgh merged commit ad3c180 into decred:master Mar 29, 2019
@davecgh
Copy link
Member

davecgh commented Mar 29, 2019

See #1706 for the aforementioned cleanup PR.

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.

3 participants