Skip to content

Commit

Permalink
get the tips by genesis id if the pruning point is 0
Browse files Browse the repository at this point in the history
  • Loading branch information
jackzhhuang committed Sep 18, 2024
1 parent ec341bc commit 7d24357
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion chain/src/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1524,7 +1524,11 @@ impl BlockChain {
new_tip_block.header().parent_hash()
)
})?;
let mut tips = self.current_tips_hash(parent_header.pruning_point())?;
let mut tips = if parent_header.pruning_point() == HashValue::zero() {
self.current_tips_hash(self.genesis_hash)?
} else {
self.current_tips_hash(parent_header.pruning_point())?
};

let mut new_tips = vec![];
for hash in tips {
Expand Down

0 comments on commit 7d24357

Please sign in to comment.