Skip to content

Commit

Permalink
fix: reintroduce DB turnaround check, as a fallback.
Browse files Browse the repository at this point in the history
  • Loading branch information
shawn-zil committed Feb 7, 2025
1 parent 96d01d3 commit 774e055
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion zilliqa/src/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -734,9 +734,10 @@ impl Sync {
// If the check-point/starting-point is in this segment
let checkpointed = segment.iter().any(|b| b.hash == self.checkpoint_hash);
let turnaround = self.started_at_block_number >= segment.last().as_ref().unwrap().number;
let block_hash = segment.last().as_ref().unwrap().hash;

// If the segment hits our history, turnaround to Phase 2.
if turnaround || checkpointed {
if turnaround || checkpointed || self.db.contains_block(&block_hash)? {
self.state = SyncState::Phase2(Hash::ZERO);
} else if Self::DO_SPECULATIVE {
self.request_missing_metadata(None)?;
Expand Down

0 comments on commit 774e055

Please sign in to comment.