Skip to content

Commit

Permalink
prune: clarify how ancestor nodes are pruned
Browse files Browse the repository at this point in the history
  • Loading branch information
qdm12 committed Jan 23, 2023
1 parent 84aead7 commit 0ece6da
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/blocktree/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ func (n *node) prune(finalised *node, forkOriginToChain map[Hash][]Hash,
if finalised.isDescendantOf(n) {
// The node is an ancestor of the finalised node.
// ... -> N -> ... -> FINALISED -> ...
// Ancestor nodes are all replaced when the root node is replaced
// by the finalised node in the `Prune` method.
// Check its children which may not be on the canonical chain
// between the node and the finalised node.
for _, child := range n.children {
Expand Down

0 comments on commit 0ece6da

Please sign in to comment.