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

seed command #83

Merged
merged 15 commits into from
Nov 13, 2019
Merged

seed command #83

merged 15 commits into from
Nov 13, 2019

Conversation

dconnolly
Copy link
Contributor

@dconnolly dconnolly commented Oct 24, 2019

Also includes some Config updates to populate default initial seeds based on the selected network (mainnet and testnet for now).

@dconnolly
Copy link
Contributor Author

dconnolly commented Oct 24, 2019

whaaat is going on with the Actions
EDIT: fixed

And more flushed out but incomplete
This may need some cleaning up, but this is the first iteration to appease the compiler.
Moved SeedService out of the command closure Command currently spawns
a tokio task to DOS the seed service with `Request::GetPeers` every
second.

Pertains to #54
@dconnolly dconnolly marked this pull request as ready for review November 12, 2019 01:42
@dconnolly dconnolly changed the title WIP: seed command seed command Nov 12, 2019
zebrad/src/commands.rs Outdated Show resolved Hide resolved
Co-Authored-By: Henry de Valence <hdevalence@hdevalence.ca>
Co-Authored-By: Henry de Valence <hdevalence@hdevalence.ca>
Co-Authored-By: Henry de Valence <hdevalence@hdevalence.ca>
Network::Mainnet => Config::parse_peers(self.initial_mainnet_peers.clone()),
Network::Testnet => Config::parse_peers(self.initial_testnet_peers.clone()),
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

take-or-leave-it: since parse_peers is never used outside of initial_peers, it could be folded in as match self.network { ... } .iter().flat_map(...).flatten().collect(), and this saves an allocation by only doing one collect instead of two.

@hdevalence
Copy link
Contributor

Yay, this is great!

@hdevalence hdevalence closed this Nov 12, 2019
@hdevalence hdevalence reopened this Nov 12, 2019
@hdevalence
Copy link
Contributor

Not great: my ability to identify buttons

dconnolly and others added 3 commits November 12, 2019 16:27
…sitive response first, otherwise panic

Co-Authored-By: Henry de Valence <hdevalence@hdevalence.ca>
Co-Authored-By: Henry de Valence <hdevalence@hdevalence.ca>
Copy link
Contributor

@hdevalence hdevalence left a comment

Choose a reason for hiding this comment

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

LGTM

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.

2 participants