refactor: Add BlockManager getters #26900

pull maflcko wants to merge 3 commits into bitcoin:master from maflcko:2301-blockman-fun-💭 changing 9 files +52 −44
  1. maflcko commented at 4:20 PM on January 16, 2023: member

    Requested in #25781 (review), but adding getters seems unrelated from removing globals, so I split it out for now.

  2. Add BlockManager::LoadingBlocks() fa0f0436d8
  3. Add BlockManager::GetPruneTarget() fae71fe27e
  4. DrahtBot commented at 4:21 PM on January 16, 2023: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK dergoegge, brunoerg

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #26969 (net: net_processing, add ProcessCompactBlockTxns by brunoerg)
    • #26247 (refactor: Make m_mempool optional in PeerManager by MarcoFalke)
    • #25977 (refactor: Replace std::optional<bilingual_str> with util::Result by ryanofsky)
    • #25740 (assumeutxo: background validation completion by jamesob)
    • #25665 (refactor: Add util::Result failure values, multiple error and warning messages by ryanofsky)
    • #25574 (validation: Improve error handling when VerifyDB fails due to insufficient dbcache by mzumsande)
    • #25193 (indexes: Read the locator's top block during init, allow interaction with reindex-chainstate by mzumsande)
    • #24230 (indexes: Stop using node internal types and locking cs_main, improve sync logic by ryanofsky)

    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.

  5. DrahtBot added the label Refactoring on Jan 16, 2023
  6. maflcko commented at 4:23 PM on January 16, 2023: member

    Required for #25781 in either case

  7. Add BlockManager::IsPruneMode() faf7b4f1fc
  8. maflcko force-pushed on Jan 16, 2023
  9. DrahtBot cross-referenced this on Jan 17, 2023 from issue assumeutxo: background validation completion by jamesob
  10. DrahtBot cross-referenced this on Jan 17, 2023 from issue refactor: Add util::Result failure values, multiple error and warning messages by ryanofsky
  11. DrahtBot cross-referenced this on Jan 17, 2023 from issue validation: Improve error handling when VerifyDB dosn't finish successfully by mzumsande
  12. DrahtBot cross-referenced this on Jan 17, 2023 from issue indexes: Read the locator's top block during init, allow interaction with reindex-chainstate by mzumsande
  13. dergoegge commented at 11:09 AM on January 17, 2023: member

    Code review ACK faf7b4f1fc35f1488567e0e4a57ecb348596b992

  14. DrahtBot cross-referenced this on Jan 19, 2023 from issue refactor: Make m_mempool optional in PeerManager by maflcko
  15. DrahtBot cross-referenced this on Jan 21, 2023 from issue refactor: Replace `std::optional<bilingual_str>` with `util::Result` by ryanofsky
  16. DrahtBot cross-referenced this on Jan 21, 2023 from issue refactor: Use util::Result class for wallet loading by ryanofsky
  17. DrahtBot cross-referenced this on Jan 21, 2023 from issue indexes: Stop using node internal types and locking cs_main, improve sync logic by ryanofsky
  18. DrahtBot cross-referenced this on Jan 26, 2023 from issue net, refactor: net_processing, add `ProcessCompactBlockTxns` by brunoerg
  19. brunoerg approved
  20. brunoerg commented at 6:54 PM on January 26, 2023: contributor

    crACK faf7b4f1fc35f1488567e0e4a57ecb348596b992

  21. maflcko merged this on Jan 27, 2023
  22. maflcko closed this on Jan 27, 2023

  23. maflcko deleted the branch on Jan 27, 2023
  24. in src/net_processing.cpp:1730 in faf7b4f1fc
    1726 | @@ -1730,8 +1727,7 @@ bool PeerManagerImpl::BlockRequestAllowed(const CBlockIndex* pindex)
    1727 |  
    1728 |  std::optional<std::string> PeerManagerImpl::FetchBlock(NodeId peer_id, const CBlockIndex& block_index)
    1729 |  {
    1730 | -    if (fImporting) return "Importing...";
    1731 | -    if (fReindex) return "Reindexing...";
    1732 | +    if (m_chainman.m_blockman.LoadingBlocks()) return "Loading blocks ...";
    


    jonatack commented at 5:27 PM on January 27, 2023:

    Nice refactoring. It looks like there is also a minor user-facing behavior change here, but at first glance only affecting RPC getblockfrompeer and probably not an issue.

  25. sidhujag referenced this in commit ddf6668248 on Jan 27, 2023
  26. Fabcien referenced this in commit a4ff6eb1a9 on Dec 19, 2023
  27. bitcoin locked this on Mar 19, 2024

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: 2026-05-20 06:53 UTC