Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In API, filter out duplicated miniblocks. #4142

Merged
merged 2 commits into from
May 31, 2022

Conversation

andreibancioiu
Copy link
Collaborator

No description provided.

@andreibancioiu andreibancioiu self-assigned this May 31, 2022
@iulianpascalau iulianpascalau self-requested a review May 31, 2022 14:02
miiu96
miiu96 previously approved these changes May 31, 2022
bogdan-rosianu
bogdan-rosianu previously approved these changes May 31, 2022
@andreibancioiu andreibancioiu marked this pull request as ready for review May 31, 2022 14:28
seenMiniblocks := make(map[string]struct{})

for _, miniblock := range miniblocks {
if _, ok := seenMiniblocks[miniblock.Hash]; ok {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could have been multiple lines

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@@ -136,6 +138,22 @@ func (sbp *shardAPIBlockProcessor) convertShardBlockBytesToAPIBlock(hash []byte,
}, nil
}

func filterOutDuplicatedMiniblocks(miniblocks []*api.MiniBlock) []*api.MiniBlock {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test? :D

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants