diff --git a/Cargo.toml b/Cargo.toml index 924a74a..9b023f6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "alfis" -version = "0.3.7" +version = "0.3.8" authors = ["Revertron "] edition = "2018" build = "build.rs" diff --git a/src/p2p/network.rs b/src/p2p/network.rs index 80124db..43b0d88 100644 --- a/src/p2p/network.rs +++ b/src/p2p/network.rs @@ -337,7 +337,7 @@ fn handle_message(context: Arc>, message: Message, peers: &mut Pe let mut context = context.lock().unwrap(); let blocks_count = context.chain.height(); context.bus.post(crate::event::Event::NetworkStatus { nodes: active_count + 1, blocks: blocks_count }); - if peer.is_higher(my_height) { + if active_count > 3 && peer.is_higher(my_height) { context.chain.update_max_height(height); context.bus.post(crate::event::Event::Syncing { have: my_height, height}); State::message(Message::GetBlock { index: my_height + 1 })