Skip to content

Commit

Permalink
Merge pull request #925 from iotaledger/fix/tip-selection
Browse files Browse the repository at this point in the history
Do not return EmptyBlockID as a shallow like parent.
  • Loading branch information
piotrm50 authored Apr 22, 2024
2 parents 8327da0 + c0b8374 commit 2844bff
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/protocol/engine/tipselection/v1/tip_selection.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,12 @@ func (t *TipSelection) likedInsteadReferences(maxLikedInsteadReferencesPerParent
return ierrors.Errorf("transaction required for liked instead reference (%s) not found in mem-pool", likedSpenderID)
}

necessaryReferences[likedSpenderID] = lo.First(transactionMetadata.ValidAttachments())
validAttachments := transactionMetadata.ValidAttachments()
if len(validAttachments) == 0 {
return ierrors.Errorf("attachment of the transaction required for liked instead reference (%s) does not exist", likedSpenderID)
}

necessaryReferences[likedSpenderID] = lo.First(validAttachments)

return nil
}); err != nil {
Expand Down

0 comments on commit 2844bff

Please sign in to comment.