Page MenuHomePhabricator

[backport#16194] refactoring: make pindexBestInvalid internal to validation.cpp
ClosedPublic

Authored by majcosta on Jul 17 2020, 21:18.

Details

Summary

There's no need to have this member live on CChainState since it's only used
in validation.cpp.

https://github.com/bitcoin/bitcoin/pull/16194/commits/55d525ab9004631d30dcc60a1ec5d9cd6c6afe56


Depends on D6967

Partial backport of Core PR16194

Test Plan
ninja check && ninja check-functional

Event Timeline

deadalnix requested changes to this revision.Jul 17 2020, 22:14
deadalnix added a subscriber: deadalnix.

Why add more global state? Isn't it some state related to the chain?

This revision now requires changes to proceed.Jul 17 2020, 22:14

this is still encapsulation theatre, since both members are still public. but at least they're on just one place now and considering PR scope, it's a start

This revision is now accepted and ready to land.Jul 21 2020, 10:28
deadalnix requested changes to this revision.Jul 21 2020, 10:29

You are correct, you can remove it from chainstate and match core.

This revision now requires changes to proceed.Jul 21 2020, 10:29

reverted to match the PR more closely

This revision is now accepted and ready to land.Jul 22 2020, 14:18