From 0ece6da910daedd07af521043a7e1579a600aac2 Mon Sep 17 00:00:00 2001 From: Quentin McGaw Date: Tue, 17 Jan 2023 14:02:21 +0000 Subject: [PATCH] `prune`: clarify how ancestor nodes are pruned --- lib/blocktree/node.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/blocktree/node.go b/lib/blocktree/node.go index 8be1b133313..1401b410d56 100644 --- a/lib/blocktree/node.go +++ b/lib/blocktree/node.go @@ -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 {