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

Problem: when adding an element to the queue, which was already prese… #79

Merged
merged 5 commits into from Oct 25, 2020

Conversation

AlexHentschel
Copy link
Member

@AlexHentschel AlexHentschel commented Oct 19, 2020

Stability improvements for mempool.Queue

  • Backport from hot-fixes applied to MainNet (as in branch mainnet1-oct17-patch)
  • added more checks to increase API safety and documentation

Summary of significant changes:

updated method Queue.TryAdd:

When adding an element to the queue, which was already present, the queue would dedup the element itself (as it is stored in a map). However, it would not duplicate the Children reference for the element's parent (as this is a list).

  • Fix: check if element to be added is already present in the queue and NoOp in this case.
  • extended goDoc on return value
  • added unittest

updated method Queue.Attach:

  • added consistency check for partially overlapping queues
  • extended godoc
  • included unit test

…nt, the queue would dedup the element itself (as it is stored in a map). However, it would duplicate the children reference for the parent (as this is a list).

Fix:
• check if element to be added is already present in the queue and NoOp in this case.
• extended goDoc on return value

updated mempool Queue method Attach:
• added consistency check for partially overlapping queues
• extended godoc
• included unit test
@Kay-Zee Kay-Zee merged commit a92ffd2 into master Oct 25, 2020
@Kay-Zee Kay-Zee deleted the alex/mempool-queue-revisions branch October 25, 2020 23:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants