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
  1. MarcoFalke commented at 6:32 pm on September 28, 2020: member
    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.
  2. MarcoFalke added the label Refactoring on Sep 28, 2020
  3. MarcoFalke added the label Validation on Sep 28, 2020
  4. practicalswift commented at 6:55 pm on September 28, 2020: contributor

    Concept ACK

    Thanks for cleaning up old cruft! :)

  5. 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.
  6. MarcoFalke closed this on Sep 28, 2020

  7. MarcoFalke deleted the branch on Sep 28, 2020
  8. DrahtBot commented at 7:35 pm on September 28, 2020: member

    The 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 to BlockManager 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.

  9. fanquake commented at 6:21 am on September 29, 2020: member

    Ah 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.

  10. MarcoFalke restored the branch on Jan 26, 2022
  11. MarcoFalke reopened this on Jan 26, 2022

  12. MarcoFalke force-pushed on Jan 26, 2022
  13. DrahtBot added the label Needs rebase on Mar 7, 2022
  14. MarcoFalke force-pushed on Mar 7, 2022
  15. DrahtBot removed the label Needs rebase on Mar 7, 2022
  16. DrahtBot added the label Needs rebase on Apr 20, 2022
  17. validation: 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.
    1721021ca5
  18. MarcoFalke force-pushed on Apr 20, 2022
  19. MarcoFalke commented at 1:37 pm on April 20, 2022: member
    Probably fixed in #22564 (refactor: Move mutable globals cleared in ::UnloadBlockIndex to BlockManager by dongcarl), so please review that first.
  20. MarcoFalke commented at 1:38 pm on April 20, 2022: member
    Leaving open for now due to #24145 (comment)
  21. DrahtBot removed the label Needs rebase on Apr 20, 2022
  22. DrahtBot added the label Needs rebase on Apr 28, 2022
  23. DrahtBot 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”.

  24. MarcoFalke closed this on Apr 28, 2022

  25. MarcoFalke deleted the branch on Apr 28, 2022
  26. DrahtBot locked this on Apr 28, 2023

github-metadata-mirror

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-12-19 06:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me