Skip to content

Commit

Permalink
add ghost if pruning occurs
Browse files Browse the repository at this point in the history
  • Loading branch information
jackzhhuang committed Dec 6, 2024
1 parent 8f01900 commit 81dbbf5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions flexidag/src/blockdag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -564,8 +564,12 @@ impl BlockDAG {
blue_blocks: &[BlockHeader],
header: &BlockHeader,
) -> Result<GhostdagData, anyhow::Error> {
self.ghost_dag_manager()
.verify_and_ghostdata(blue_blocks, header)
if header.pruning_point() != HashValue::zero() {
self.ghost_dag_manager().ghostdag(&header.parents())
} else {
self.ghost_dag_manager()
.verify_and_ghostdata(blue_blocks, header)
}
}
pub fn check_upgrade(&self, main: &BlockHeader, genesis_id: HashValue) -> anyhow::Result<()> {
// set the state with key 0
Expand Down

0 comments on commit 81dbbf5

Please sign in to comment.