From 181299b96504ccad202db502ab75e737a349cf99 Mon Sep 17 00:00:00 2001 From: jackzhhuang Date: Sat, 23 Mar 2024 06:28:09 +0800 Subject: [PATCH] put the parents in ancestor --- sync/src/tasks/block_sync_task.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sync/src/tasks/block_sync_task.rs b/sync/src/tasks/block_sync_task.rs index 3366770705..20a0b4fb12 100644 --- a/sync/src/tasks/block_sync_task.rs +++ b/sync/src/tasks/block_sync_task.rs @@ -373,12 +373,11 @@ where continue; } absent_blocks.push(parent) - } else { - if ancestors.contains(&parent) { - continue; - } - ancestors.push(parent); + } + if ancestors.contains(&parent) { + continue; } + ancestors.push(parent); } Ok(()) }