Skip to content

Commit

Permalink
Merge branch 'fix-suggestedLowHash' into HEAD
Browse files Browse the repository at this point in the history
  • Loading branch information
someone235 committed Mar 12, 2022
2 parents df0e46a + cfc9d5a commit bec32fc
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion domain/consensus/processes/pruningmanager/pruningmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -1009,7 +1009,15 @@ func (pm *pruningManager) ExpectedHeaderPruningPoint(stagingArea *model.StagingA
}

if hasReachabilityData {
suggestedLowHash = selectedParentHeader.PruningPoint()
// nextPruningPointAndCandidateByBlockHash needs suggestedLowHash to be in the future of the pruning point because
// otherwise reachability selected chain data is unreliable.
isInFutureOfCurrentPruningPoint, err := pm.dagTopologyManager.IsAncestorOf(stagingArea, pruningPoint, selectedParentHeader.PruningPoint())
if err != nil {
return nil, err
}
if isInFutureOfCurrentPruningPoint {
suggestedLowHash = selectedParentHeader.PruningPoint()
}
}

nextOrCurrentPruningPoint, _, err = pm.nextPruningPointAndCandidateByBlockHash(stagingArea, blockHash, suggestedLowHash)
Expand Down

0 comments on commit bec32fc

Please sign in to comment.