refactor: GetFirstStoredBlock() and getblockchaininfo follow-ups #25016

pull jonatack wants to merge 3 commits into bitcoin:master from jonatack:GetFirstStoredBlock-improvements changing 4 files +13 −12
  1. jonatack commented at 5:18 pm on April 28, 2022: member

    Picks up the remaining review feedback in #21726 and #24956.

    • make the global function GetFirstStoredBlock() a member of the BlockManager class
    • pass the start_block param of GetFirstStoredBlock() by reference instead of a pointer
    • use GetBlockTime() for RPC getblockchaininfo#time
  2. DrahtBot added the label Block storage on Apr 28, 2022
  3. DrahtBot added the label RPC/REST/ZMQ on Apr 28, 2022
  4. DrahtBot added the label UTXO Db and Indexes on Apr 28, 2022
  5. blockstorage, refactor: make GetFirstStoredBlock() a member of BlockManager
    instead of a global
    ed12c0a49d
  6. blockstorage, refactor: pass GetFirstStoredBlock() start_block by reference
    instead of by pointer, so as to not accept a nullptr.
    86ce844d3b
  7. MarcoFalke removed the label UTXO Db and Indexes on Apr 28, 2022
  8. MarcoFalke removed the label RPC/REST/ZMQ on Apr 28, 2022
  9. MarcoFalke removed the label Block storage on Apr 28, 2022
  10. MarcoFalke added the label Refactoring on Apr 28, 2022
  11. jonatack renamed this:
    blockstorage, refactor: improve GetFirstStoredBlock()
    blockstorage, refactor: GetFirstStoredBlock() follow-ups
    on Apr 28, 2022
  12. rpc: use GetBlockTime() for getblockchaininfo#time e2b954e87f
  13. jonatack force-pushed on Apr 28, 2022
  14. jonatack commented at 6:54 pm on April 28, 2022: member
    Updated now that #24956 is merged, and ready for review.
  15. jonatack renamed this:
    blockstorage, refactor: GetFirstStoredBlock() follow-ups
    refactor: GetFirstStoredBlock() and getblockchaininfo follow-ups
    on Apr 28, 2022
  16. MarcoFalke approved
  17. MarcoFalke commented at 6:55 pm on April 28, 2022: member
    ACK e2b954e87f0c4cd5c8ac6e4d9c6b4d784844b4d2
  18. fanquake merged this on Apr 29, 2022
  19. fanquake closed this on Apr 29, 2022

  20. jonatack deleted the branch on Apr 29, 2022
  21. sidhujag referenced this in commit cd0f3ec4a9 on Apr 29, 2022
  22. in src/node/blockstorage.cpp:393 in e2b954e87f
    389@@ -390,10 +390,10 @@ bool BlockManager::IsBlockPruned(const CBlockIndex* pblockindex)
    390     return (m_have_pruned && !(pblockindex->nStatus & BLOCK_HAVE_DATA) && pblockindex->nTx > 0);
    391 }
    392 
    393-const CBlockIndex* GetFirstStoredBlock(const CBlockIndex* start_block) {
    394+const CBlockIndex* BlockManager::GetFirstStoredBlock(const CBlockIndex& start_block)
    


    MarcoFalke commented at 8:30 am on April 30, 2022:
    In theory start_block could be marked LIFETIMEBOUND.

    jonatack commented at 8:54 pm on May 3, 2022:

    In theory start_block could be marked LIFETIMEBOUND.

    Ah, yes; done in #25060.

  23. MarcoFalke referenced this in commit d17bbc3c48 on May 4, 2022
  24. sidhujag referenced this in commit cedc09f1e9 on May 4, 2022
  25. DrahtBot locked this on May 3, 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-09-29 01:12 UTC

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