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

Simplify bootstrapping process #1699

Merged

Conversation

nazar-pc
Copy link
Member

Code contributor checklist:

@nazar-pc nazar-pc force-pushed the change_bootstrapping-simplification branch from e8bf334 to 76e464a Compare July 26, 2023 15:11
@shamil-gadelshin
Copy link
Member

This seems simpler and it appears to work as expected: #1702

@nazar-pc
Copy link
Member Author

This seems simpler and it appears to work as expected: #1702

Most of the time yes, but it is not doing precisely what we need and nothing else. This PR does.

Copy link
Member

@shamil-gadelshin shamil-gadelshin left a comment

Choose a reason for hiding this comment

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

It seems working as expected. There are a couple of minor issues.

let mut bootstrap_command_state = bootstrap_command_state.lock().await;
let bootstrap_command_receiver = match &mut *bootstrap_command_state {
BootstrapCommandState::NotStarted => {
error!("Bootstrap started.");
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
error!("Bootstrap started.");
debug!("Bootstrap started.");

@@ -246,14 +253,38 @@ where

/// Bootstraps Kademlia network
async fn bootstrap(&mut self) {
self.was_bootstrapped = true;
let bootstrap_command_state = Arc::clone(&self.bootstrap_command_state);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
let bootstrap_command_state = Arc::clone(&self.bootstrap_command_state);
let bootstrap_command_state = self.bootstrap_command_state.clone();

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