Skip to content
Merged
Show file tree
Hide file tree
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
28 changes: 24 additions & 4 deletions dash-spv/src/sync/phase_execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,11 @@ impl<
self.transition_to_next_phase(storage, network, "No blocks to download").await?;
}

_ => {
// Idle or FullySynced - nothing to execute
SyncPhase::Idle
| SyncPhase::FullySynced {
..
} => {
// Nothing to execute
}
}

Expand Down Expand Up @@ -422,7 +425,15 @@ impl<
}
}
}
_ => {}
SyncPhase::Idle
| SyncPhase::FullySynced {
..
}
| SyncPhase::DownloadingBlocks {
..
} => {
// Nothing to execute
}
}

Ok(())
Expand Down Expand Up @@ -467,7 +478,16 @@ impl<
} => {
self.filter_sync.check_cfheader_request_timeouts(network, storage).await?;
}
_ => {
SyncPhase::Idle
| SyncPhase::DownloadingFilters {
..
}
| SyncPhase::DownloadingBlocks {
..
}
| SyncPhase::FullySynced {
..
} => {
// For other phases, we'll need phase-specific recovery
}
}
Expand Down
15 changes: 12 additions & 3 deletions dash-spv/src/sync/phases.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,10 @@ impl SyncPhase {
last_progress,
..
} => Some(*last_progress),
_ => None,
SyncPhase::Idle
| SyncPhase::FullySynced {
..
} => None,
}
}

Expand Down Expand Up @@ -198,7 +201,10 @@ impl SyncPhase {
last_progress,
..
} => *last_progress = now,
_ => {}
SyncPhase::Idle
| SyncPhase::FullySynced {
..
} => {}
}
}
}
Expand Down Expand Up @@ -421,7 +427,10 @@ impl SyncPhase {
}
}

_ => PhaseProgress {
SyncPhase::Idle
| SyncPhase::FullySynced {
..
} => PhaseProgress {
phase_name: self.name(),
items_completed: 0,
items_total: None,
Expand Down