-
Notifications
You must be signed in to change notification settings - Fork 36.7k
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
validation: Remove useless call to mempool->clear() #20030
Conversation
Concept ACK Thanks for cleaning up old cruft! :) |
src/init.cpp
Outdated
@@ -1563,7 +1563,7 @@ bool AppInitMain(const util::Ref& context, NodeContext& node, interfaces::BlockA | |||
chainman.m_total_coinstip_cache = nCoinCacheUsage; | |||
chainman.m_total_coinsdb_cache = nCoinDBCache; | |||
|
|||
UnloadBlockIndex(node.mempool.get(), chainman); | |||
UnloadBlockIndex(chainman); |
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.
Are we sure that there is no need to reset the mempool here? Could anything have been added to it further in this loop?
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.
Yes, otherwise I wouldn't have opened the pull request. You probably wanted to say that the review effort is not worth it?
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.
No, I just wanted to make sure you hadn't missed the fact that there is a loop here.
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.
Ah ok. I might reopen some other day, unless someone beats me to it.
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
Concept ACK. If these calls really are no-longer doing anything I can't see why they shouldn't be removed and |
fa2df0c
to
fa6350e
Compare
fa6350e
to
fabe5f6
Compare
The mempool.clear() in UnloadBlockIndex has been added in commit 51598b2 to clear global state between unit tests. Now that there is no global mempool anymore, this it not needed anymore. Also, the clear isn't used for anything else in the current code.
fabe5f6
to
1721021
Compare
Probably fixed in #22564 (refactor: Move mutable globals cleared in ::UnloadBlockIndex to BlockManager by dongcarl), so please review that first. |
Leaving open for now due to #24145 (comment) |
🐙 This pull request conflicts with the target branch and needs rebase. Want to unsubscribe from rebase notifications on this pull request? Just convert this pull request to a "draft". |
The mempool.clear() in UnloadBlockIndex has been added in commit 51598b2
to clear global state between unit tests. Now that there is no global
mempool anymore, this it not needed anymore. Also, the clear isn't used
for anything else in the current code.