CBlockIndexWorkComparator belongs in its own header rather than validation.cpp. Also, this makes it more accessible for writing tests.
Details
Details
- Reviewers
deadalnix schancel - Group Reviewers
Restricted Project - Commits
- rSTAGING14893d239ab6: Move CBlockIndexWorkComparator to its own header
rABC14893d239ab6: Move CBlockIndexWorkComparator to its own header
make check
Diff Detail
Diff Detail
- Repository
- rABC Bitcoin ABC
- Branch
- comp
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 2796 Build 3702: Bitcoin ABC Buildbot (legacy) Build 3701: arc lint + arc unit
Event Timeline
Comment Actions
Can you explain why the is moving into an header ? Probably belongs here is not a very good reason. If somethign is used only in one place, it belong there. Writing a test is a good reason to do it, but right now there are no tests for it.
Comment Actions
Ok so we discussed this offline.
The benefit of putting this in a header is obviously to be able to write tests for it, which is great. The downside is that changing it will require to recompile half of the world due to chain.h being a very common header. A good way to proceed here would be to create a new header for CBlockIndexWorkComparator and include that header in validation.cpp instead of moving it into chain.h .