Skip to content

Commit

Permalink
fix the absent block saving process
Browse files Browse the repository at this point in the history
  • Loading branch information
jackzhhuang committed Sep 14, 2024
1 parent df3ed29 commit 2b72652
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions sync/src/tasks/block_sync_task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -399,14 +399,22 @@ where
return Ok(());
}
for parent in parents {
if self.local_store.get_dag_sync_block(parent)?.is_none() {
if absent_blocks.contains(&parent) {
continue;
match self.local_store.get_dag_sync_block(parent)? {
Some(block) => {
if self.chain.has_dag_block(parent)? {
continue;
}
self.sync_dag_store.save_block(block.block)?;
}
if self.chain.has_dag_block(parent)? {
continue;
None => {
if absent_blocks.contains(&parent) {
continue;
}
if self.chain.has_dag_block(parent)? {
continue;
}
absent_blocks.push(parent)
}
absent_blocks.push(parent)
}
}
Ok(())
Expand Down

0 comments on commit 2b72652

Please sign in to comment.