Include dependency hierarchy is spaghetti #1105

issue laanwj opened this issue on April 15, 2012
  1. laanwj commented at 6:21 PM on April 15, 2012: member

    Today I played around a bit with libclang and made a graph of include dependencies:

    https://dev.visucore.com/bitcoin/includes.svg

    Edges show a source file that is included into another. You can hover over connections to highlight them, this can help clarify spaghetti parts.

    • it would be nice to get rid of headers.h and include only what we need in every compilation unit.
      • Newer files (such as addrman.cpp, protocol.cpp, version.cpp) are more well-behaved in this regard.
    • util.h, protocol.h probably pull in too much.
    • the hierarchy is too deep; include files shouldn't include that many other include files. For example headers.hutil.huint256.hserialize.hallocators.h ...
    • moving code from .h to .cpp files where possible / efficient would help reduce interdependencies
  2. gavinandresen commented at 7:20 PM on April 15, 2012: contributor

    Agreed on all points, but I vote for this being cleaned up over the next 6 months not in a "change the world" pull request.

  3. sipa commented at 11:12 PM on April 15, 2012: member

    Sorry @gavinandresen, see #1108 and #1109...

  4. laanwj closed this on Apr 19, 2012

  5. suprnurd referenced this in commit afc74707f8 on Dec 5, 2017
  6. lateminer referenced this in commit d64ee1ccc3 on Jan 22, 2019
  7. lateminer referenced this in commit e4e5df1018 on Nov 14, 2019
  8. 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: 2026-04-13 15:16 UTC

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