Skip to content
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
12 changes: 11 additions & 1 deletion src/chain_sync/chain_follower.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
use super::network_context::SyncNetworkContext;
use crate::{
blocks::{Block, FullTipset, Tipset, TipsetKey},
chain::ChainStore,
chain::{ChainStore, index::ResolveNullTipset},
chain_sync::{
ForkSyncInfo, ForkSyncStage, SyncStatus, SyncStatusReport, TipsetValidator,
bad_block_cache::{BadBlockCache, SeenBlockCache},
Expand Down Expand Up @@ -698,6 +698,16 @@ impl<DB: Blockstore> SyncStateMachine<DB> {
return;
}

// Skip if tipset is part of the current chain.
if let Ok(Some(ts)) = self.cs.chain_index().tipset_by_height(
tipset.epoch(),
self.cs.heaviest_tipset(),
ResolveNullTipset::TakeOlder,
) && ts.key() == tipset.key()
{
return;
}

// Find any existing tipsets with same epoch and parents
let mut to_remove = Vec::new();
#[allow(clippy::mutable_key_type)]
Expand Down
Loading