Make mapBlockIndex and chainActive and all CBlockIndex*es const outside of validation/CChainState #10692

pull TheBlueMatt wants to merge 26 commits into bitcoin:master from TheBlueMatt:2017-04-const-mapblockindex changing 21 files +520 −341
  1. TheBlueMatt commented at 4:49 pm on June 28, 2017: member
    This is based on #10279 and is all just pretty mechanical (largely scripted) changes to make mapBlockIndex/chainActive/CBlockIndex*es const outside of validation.cpp/CChainState!
  2. practicalswift commented at 6:01 pm on June 28, 2017: contributor
    Concept ACK. Needs rebase! :-)
  3. fanquake added the label Refactoring on Jun 29, 2017
  4. Make DisconnectBlock unaware of where undo data resides on disk f2902136aa
  5. Move txindex/undo data disk location stuff out of ConnectBlock 8559637128
  6. Move block writing out of AcceptBlock dc461681ff
  7. Create initial CChainState to hold chain state information a6e978884e
  8. Move some additional variables into CChainState private 21ec3737e5
  9. Avoid calling GetSerializeSize on each tx in a block if !fTxIndex 3b78b2d9ef
  10. Expose const CBlockIndexes in validation.h, update wallet rescan 32f3b1df7b
  11. Use const CBlockIndex* instead of const_cast in qt/clientmodel bcc21f2421
  12. scripted-diff: constify CBlockIndex* outside of validation
    -BEGIN VERIFY SCRIPT-
    sed -i "s/\(const \)*CBlockIndex/const CBlockIndex/" src/qt/transactionrecord.cpp src/rest.cpp src/miner.cpp src/init.cpp src/rpc/*.cpp src/wallet/*.cpp
    -END VERIFY SCRIPT-
    3afcd25d97
  13. scripted-diff: Use BlockMap::const_iterators outside of validation
    -BEGIN VERIFY SCRIPT-
    sed -i "s/BlockMap::iterator/BlockMap::const_iterator/" src/rpc/*.cpp src/wallet/*.cpp src/qt/transactionrecord.cpp src/net_processing.cpp
    -END VERIFY SCRIPT-
    85b501a16d
  14. scripted-diff: mapBlockIndex[] -> .at outside of validation
    -BEGIN VERIFY SCRIPT-
    sed -i "s/mapBlockIndex\[\(.*\)\]/mapBlockIndex.at(\1)/g" src/rest.cpp src/wallet/*.cpp src/rpc/*.cpp
    -END VERIFY SCRIPT-
    24a6bd09c4
  15. Move mapBlockIndex cleanup inside CChainState dd8ed98a00
  16. Move chainActive tip setting into CChainState from LoadBlockIndexDB ac9af80088
  17. Make mapBlockIndex const in validation.h bda2d156b9
  18. Create new "NonConstBlockMap" typdef for CChainState c1ea0aa6f8
  19. scripted-diff: Use NonConstBlockMap type for validation iterators
    -BEGIN VERIFY SCRIPT-
    sed -i "s/BlockMap::iterator/NonConstBlockMap::iterator/" src/validation.cpp
    -END VERIFY SCRIPT-
    d718e990d0
  20. Move NonConstBlockMap into CChainState ffaebe1d68
  21. Make mapBlockIndex's CBlockIndex* const outside of CChainState cd83402f7e
  22. Make some CBlockIndex*s in validation const where appropriate e26d8997b0
  23. Make some CBlockIndex*es in wallet_tests const 9b97cee6d7
  24. Add a const_cast'ed reference to chainActive in miner_tests 0573c1486f
  25. scripted-diff: Use nonCosntChainActive in miner_tests
    -BEGIN VERIFY SCRIPT-
    sed -i "s/chainActive\./nonConstChainActive./" src/test/miner_tests.cpp
    -END VERIFY SCRIPT-
    cd390ed58f
  26. Make VerifyDB a CChainState member instead of a loose class 2606cebc0b
  27. Use chainstate's CBlockIndexes in sequence lock calculation f5b8e70a82
  28. Make CChain only return const CBlockIndex* in const functions b8f5e4da97
  29. Make chainActive and pindexBestHeader const CBlockIndex*s bbe2069406
  30. TheBlueMatt force-pushed on Aug 15, 2017
  31. TheBlueMatt commented at 10:09 pm on August 15, 2017: member
    Rebased.
  32. TheBlueMatt commented at 7:41 pm on March 27, 2018: member
    Superceded.
  33. TheBlueMatt closed this on Mar 27, 2018

  34. MarcoFalke locked this on Sep 8, 2021

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-22 15:12 UTC

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