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

Avoid broadcasting mempool rejected or expired transactions to peers #2858

Merged
merged 10 commits into from
Oct 13, 2021

Conversation

oxarbitrage
Copy link
Contributor

Motivation

We want to avoid sending transactions to peers that were rejected or expired. Resolves #2846 if merged.

Solution

Broadcast only if the transaction returns Ok from the insert method. Also remove transactions that are expired.

Review

I think the intersection code can be simplified so i am looking for suggestions there. Also this code does not have a specific test.

@dconnolly dconnolly added this to the 2021 Sprint 20 milestone Oct 11, 2021
Copy link
Contributor

@teor2345 teor2345 left a comment

Choose a reason for hiding this comment

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

Looks good!

We could merge the code as-is.
But it still needs a test for each kind of skipped transaction ID.

I also made some suggestions to simplify the code.

@teor2345 teor2345 removed this from the 2021 Sprint 20 milestone Oct 12, 2021
@teor2345
Copy link
Contributor

The linked issue is in the sprint, so this PR doesn't need to be in the sprint as well.

@oxarbitrage oxarbitrage marked this pull request as ready for review October 12, 2021 19:49
Copy link
Contributor

@dconnolly dconnolly left a comment

Choose a reason for hiding this comment

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

👍

@teor2345 teor2345 enabled auto-merge (squash) October 12, 2021 22:38
@teor2345 teor2345 merged commit 8120e8a into ZcashFoundation:main Oct 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Do not broadcast expired and rejected transactions to peers
3 participants