This repository was archived by the owner on Oct 28, 2021. It is now read-only.
Stop tracking sent transactions once they've been imported into the blockchain#5706
Merged
halfalicious merged 3 commits intomasterfrom Jul 30, 2019
Merged
Stop tracking sent transactions once they've been imported into the blockchain#5706halfalicious merged 3 commits intomasterfrom
halfalicious merged 3 commits intomasterfrom
Conversation
4889e70 to
7462446
Compare
Remove transactions from EthereumCapability's list of sent transactions (which it uses to prevent sending the same transaction to peers more than once) once they've made it into the blockchain.
4e33711 to
0738b64
Compare
Codecov Report
@@ Coverage Diff @@
## master #5706 +/- ##
==========================================
+ Coverage 62.98% 62.99% +0.01%
==========================================
Files 351 350 -1
Lines 30014 30001 -13
Branches 3367 3363 -4
==========================================
- Hits 18903 18900 -3
+ Misses 9890 9882 -8
+ Partials 1221 1219 -2 |
gumb0
approved these changes
Jul 30, 2019
Member
gumb0
left a comment
There was a problem hiding this comment.
Looks fine, just two minor suggestions
libethereum/Client.cpp
Outdated
| goodTransactions.push_back(t.sha3()); | ||
| } | ||
| auto h = m_host.lock(); | ||
| if (h && goodTransactions.size()) |
Member
There was a problem hiding this comment.
Suggested change
| if (h && goodTransactions.size()) | |
| if (h && !goodTransactions.empty()) |
Member
There was a problem hiding this comment.
I would move the check for empty vector inside removeSentTransactions
Contributor
Author
There was a problem hiding this comment.
Good point, that way we get the benefit of the check for all callers.
Move empty check into EthereumCapability::removeSentTransactions (so that it's performed regardless of the caller) and use empty() to check for empty condition rather than !size().
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix #5686