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

Fix forward sync explicit index ref #1956

Merged
merged 1 commit into from
Jun 5, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions base_layer/core/src/base_node/states/forward_block_sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,12 +237,13 @@ async fn download_blocks<B: BlockchainBackend + 'static>(
match shared.comms.fetch_blocks_with_hashes(curr_headers.clone()).await {
Ok(blocks) => {
info!(target: LOG_TARGET, "Received {} blocks from peer", blocks.len());

if let StatusInfo::BlockSync(ref mut info) = shared.info {
info.tip_height = Some(blocks[blocks.len() - 1].block().header.height);
info.local_height = Some(blocks[0].block().header.height);
if !blocks.is_empty() {
if let StatusInfo::BlockSync(ref mut info) = shared.info {
info.tip_height = Some(blocks[blocks.len() - 1].block().header.height);
info.local_height = Some(blocks[0].block().header.height);
}
shared.publish_event_info().await;
sdbondi marked this conversation as resolved.
Show resolved Hide resolved
}
shared.publish_event_info().await;
for i in 0..blocks.len() {
let hist_block = &blocks[i];
let header = &curr_headers[i];
Expand Down