Initialize the selcted parent on GHOSTDAG.

This commit is contained in:
tal 2021-04-08 14:27:22 +03:00
parent 7d20ee6b58
commit 16a83f9bac

View File

@ -57,6 +57,7 @@ func (gh *ghostdagHelper) GHOSTDAG(stagingArea *model.StagingArea, blockCandidat
maxBlueWork := new(big.Int) maxBlueWork := new(big.Int)
maxBlueWork.SetUint64(0) maxBlueWork.SetUint64(0)
maxBlueScore := uint64(0) maxBlueScore := uint64(0)
selectedParent = parents[0]
// Find the selected parent. // Find the selected parent.
for _, parent := range parents { for _, parent := range parents {
parentBlockData, err := gh.dataStore.Get(gh.dbAccess, stagingArea, parent) parentBlockData, err := gh.dataStore.Get(gh.dbAccess, stagingArea, parent)