[bitcoin/bitcoin] refactor: Removal of circular dependency between index/txindex, validation and index/base (#13942)

After PR #13033 and PR #13243 there is a useful framework to add more indexes other than txindex, however circular dependencies detected by lint (`index/txindex -> validation -> index/txindex` and `index/txindex -> index/base -> validation -> index/txindex`) would prevent such solution to pass CI checks without adding an exception rule in check scrypt. In case one calls newly added index method in `validation.cpp`, another circular dependency is created because new index is supposed to inherit from index/base. My proposition is to split `validation.cpp` into two parts, one with its core features / functionalities and other with utils used in other translation units that require including `validation`. No functional change in code is expected here as it is only moved between files, and a circular dependency is removed.
You can view, comment on, or merge this pull request online at:

https://github.com/bitcoin/bitcoin/pull/13942

— Commit Summary —

* refactor: removal of cyclic dependencies between index/txindex, validation and index/base translation units
* index/txindex -> validation -> index/txindex circular dependency removed from lint-circular-dependencies.sh

— File Changes —

M src/Makefile.am (2)
M src/index/base.cpp (2)
M src/index/txindex.cpp (2)
M src/validation.cpp (137)
M src/validation.h (93)
A src/validation_globals.cpp (144)
A src/validation_globals.h (114)
M test/lint/lint-circular-dependencies.sh (1)

— Patch Links —

https://github.com/bitcoin/bitcoin/pull/13942.patch
https://github.com/bitcoin/bitcoin/pull/13942.diff

Добавить комментарий