mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-03-30 15:08:33 +00:00
Use nil suggestedLowHash if selected parent pruning point is not in the future of the current one (#1972)
Co-authored-by: stasatdaglabs <39559713+stasatdaglabs@users.noreply.github.com>
This commit is contained in:
parent
c81506220b
commit
7a95f0c7a4
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user