[NOD-704] Call dag.IsInSelectedParentChain in every iteration of dag.SelectedParentChain (#606)

This commit is contained in:
Svarog 2020-01-27 17:09:41 +02:00 committed by Ori Newman
parent 11de12304e
commit bf36f9ceb6

View File

@ -1517,6 +1517,11 @@ func (dag *BlockDAG) SelectedParentChain(blockHash *daghash.Hash) ([]*daghash.Ha
node := dag.index.LookupNode(blockHash)
blockHash = node.selectedParent.hash
isBlockInSelectedParentChain, err = dag.IsInSelectedParentChain(blockHash)
if err != nil {
return nil, nil, err
}
}
// Find the index of the blockHash in the selectedParentChainSlice