validation: Remove useless call to mempool->clear() #20030
pull MarcoFalke wants to merge 1 commits into bitcoin:master from MarcoFalke:2009-valMemClear changing 4 files +7 −7-
MarcoFalke commented at 6:32 pm on September 28, 2020: memberThe 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.
-
MarcoFalke added the label Refactoring on Sep 28, 2020
-
MarcoFalke added the label Validation on Sep 28, 2020
-
practicalswift commented at 6:55 pm on September 28, 2020: contributor
Concept ACK
Thanks for cleaning up old cruft! :)
-
in src/init.cpp:1566 in fa2df0cd3c outdated
1562@@ -1563,7 +1563,7 @@ bool AppInitMain(const util::Ref& context, NodeContext& node, interfaces::BlockA 1563 chainman.m_total_coinstip_cache = nCoinCacheUsage; 1564 chainman.m_total_coinsdb_cache = nCoinDBCache; 1565 1566- UnloadBlockIndex(node.mempool.get(), chainman); 1567+ UnloadBlockIndex(chainman);
sipa commented at 7:01 pm on September 28, 2020:Are we sure that there is no need to reset the mempool here? Could anything have been added to it further in this loop?
MarcoFalke commented at 7:29 pm on September 28, 2020:Yes, otherwise I wouldn’t have opened the pull request. You probably wanted to say that the review effort is not worth it?
sipa commented at 7:30 pm on September 28, 2020:No, I just wanted to make sure you hadn’t missed the fact that there is a loop here.
MarcoFalke commented at 7:35 pm on September 28, 2020:Ah ok. I might reopen some other day, unless someone beats me to it.MarcoFalke closed this on Sep 28, 2020
MarcoFalke deleted the branch on Sep 28, 2020DrahtBot commented at 7:35 pm on September 28, 2020: memberThe following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
Conflicts
Reviewers, this pull request conflicts with the following ones:
- #24595 (deploymentstatus: move g_versionbitscache global to ChainstateManager by ajtowns)
- #24232 (assumeutxo: add init and completion logic by jamesob)
- #24008 (assumeutxo: net_processing changes by jamesob)
- #22564 (refactor: Move mutable globals cleared in
::UnloadBlockIndex
toBlockManager
by dongcarl)
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.
fanquake commented at 6:21 am on September 29, 2020: memberAh ok. I might reopen some other day, unless someone beats me to it.
Concept ACK. If these calls really are no-longer doing anything I can’t see why they shouldn’t be removed and
UnloadBlockIndex
simplified.MarcoFalke restored the branch on Jan 26, 2022MarcoFalke reopened this on Jan 26, 2022
MarcoFalke force-pushed on Jan 26, 2022DrahtBot added the label Needs rebase on Mar 7, 2022MarcoFalke force-pushed on Mar 7, 2022DrahtBot removed the label Needs rebase on Mar 7, 2022DrahtBot added the label Needs rebase on Apr 20, 2022validation: Remove useless call to mempool->clear()
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.
MarcoFalke force-pushed on Apr 20, 2022MarcoFalke commented at 1:37 pm on April 20, 2022: memberProbably fixed in #22564 (refactor: Move mutable globals cleared in ::UnloadBlockIndex to BlockManager by dongcarl), so please review that first.MarcoFalke commented at 1:38 pm on April 20, 2022: memberLeaving open for now due to #24145 (comment)DrahtBot removed the label Needs rebase on Apr 20, 2022DrahtBot added the label Needs rebase on Apr 28, 2022DrahtBot commented at 10:53 am on April 28, 2022: member🐙 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”.
MarcoFalke closed this on Apr 28, 2022
MarcoFalke deleted the branch on Apr 28, 2022DrahtBot locked this on Apr 28, 2023
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-11-17 18:12 UTC
More mirrored repositories can be found on mirror.b10c.me