-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
mempool: add txs from Update to cache #2882
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #2882 +/- ##
===========================================
+ Coverage 62.1% 62.16% +0.06%
===========================================
Files 212 212
Lines 17288 17293 +5
===========================================
+ Hits 10736 10750 +14
+ Misses 5647 5635 -12
- Partials 905 908 +3
|
mempool/mempool_test.go
Outdated
@@ -163,6 +163,18 @@ func TestMempoolFilters(t *testing.T) { | |||
} | |||
} | |||
|
|||
func TestMempoolUpdate(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps rename to TestMempoolUpdate_cache
, or something to that extent. From the name, I thought it was going to test that update removed the tx from the mempool list itself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
- rename filterTxs to removeTxs - move txsMap into removeTxs func - rename goodTxs to txsLeft
We should add txs that come in from mempool.Update to the mempool's cache, so that they never hit a potentially expensive check tx. Originally posted by @ValarDragon in #2846 #2846 (comment) Refs #2855
5598fe3
to
3c8d893
Compare
Fixes #2855
Updated all relevant documentation in docs