From 82cc0e913a76b4abd44af43cd52ae8ec3a0bc14f Mon Sep 17 00:00:00 2001 From: jackzhhuang Date: Sat, 7 Sep 2024 12:44:15 +0800 Subject: [PATCH] use parents only --- flexidag/src/blockdag.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/flexidag/src/blockdag.rs b/flexidag/src/blockdag.rs index 054f01af07..1503215753 100644 --- a/flexidag/src/blockdag.rs +++ b/flexidag/src/blockdag.rs @@ -218,18 +218,19 @@ impl BlockDAG { ); let reachability_store = self.storage.reachability_store.clone(); - let mut merge_set = ghostdata - .unordered_mergeset_without_selected_parent() - .filter(|hash| self.storage.reachability_store.read().has(*hash).unwrap()) - .collect::>() - .into_iter(); + // let mut merge_set = ghostdata + // .unordered_mergeset_without_selected_parent() + // .filter(|hash| self.storage.reachability_store.read().has(*hash).unwrap()) + // .collect::>() + // .into_iter(); + let merge_set = header.parents(); let add_block_result = { let mut reachability_writer = reachability_store.write(); inquirer::add_block( reachability_writer.deref_mut(), header.id(), ghostdata.selected_parent, - &mut merge_set, + &mut merge_set.into_iter(), ) }; match add_block_result {