diff --git a/src/p2p/network.rs b/src/p2p/network.rs index 30b27e4..4d7f97f 100644 --- a/src/p2p/network.rs +++ b/src/p2p/network.rs @@ -347,6 +347,8 @@ fn handle_message(context: Arc>, message: Message, peers: &mut Pe peer.set_height(height); peer.set_active(true); if peer.is_higher(my_height) || ( height == my_height && my_hash != hash) { + let mut context = context.lock().unwrap(); + context.chain.update_max_height(height); State::message(Message::GetBlock { index: my_height + 1 }) } else { State::message(Message::pong(my_height, my_hash)) @@ -363,6 +365,7 @@ fn handle_message(context: Arc>, message: Message, peers: &mut Pe context.bus.post(crate::event::Event::NetworkStatus { nodes: peers.get_peers_active_count(), blocks: blocks_count }); if is_higher { + context.chain.update_max_height(height); State::message(Message::GetBlock { index: my_height + 1 }) } else if my_hash != hash { State::message(Message::GetBlock { index: my_height }) diff --git a/src/webview/index.html b/src/webview/index.html index 2c08b58..f61678f 100644 --- a/src/webview/index.html +++ b/src/webview/index.html @@ -76,7 +76,7 @@ -