mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-11-24 06:25:55 +00:00
Parents must be picked first before set as virtual parents
This commit is contained in:
parent
4edba5df8b
commit
c93f310d20
@ -168,10 +168,17 @@ func (csm *consensusStateManager) ResolveVirtual(maxBlocksToResolve uint64) (*ex
|
||||
// If `isCompletelyResolved`, set virtual correctly with all tips which have less blue work than pending
|
||||
virtualTipCandidates := []*externalapi.DomainHash{intermediateTip}
|
||||
if isCompletelyResolved {
|
||||
virtualTipCandidates, err = csm.getLowerTips(readStagingArea, pendingTip)
|
||||
lowerTips, err := csm.getLowerTips(readStagingArea, pendingTip)
|
||||
if err != nil {
|
||||
return nil, false, err
|
||||
}
|
||||
|
||||
log.Debugf("Picking virtual parents from relevant tips len: %d", len(lowerTips))
|
||||
virtualTipCandidates, err = csm.pickVirtualParents(readStagingArea, lowerTips)
|
||||
if err != nil {
|
||||
return nil, false, err
|
||||
}
|
||||
log.Debugf("Picked virtual parents: %s", virtualTipCandidates)
|
||||
}
|
||||
virtualUTXODiff, err := csm.updateVirtualWithParents(updateVirtualStagingArea, virtualTipCandidates)
|
||||
if err != nil {
|
||||
@ -183,7 +190,6 @@ func (csm *consensusStateManager) ResolveVirtual(maxBlocksToResolve uint64) (*ex
|
||||
return nil, false, err
|
||||
}
|
||||
|
||||
// TODO: why was `readStagingArea` used here ?
|
||||
selectedParentChainChanges, err := csm.dagTraversalManager.
|
||||
CalculateChainPath(updateVirtualStagingArea, prevVirtualSelectedParent, pendingTip)
|
||||
if err != nil {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user