Fixed a bug where an invalidated or parked block would have child state applied to it even when its parent block is not invalidated or parked.
Summary:
Discovered while debugging parked chain behavior. I noticed the BlockStatus had unexpected combinations of state. With a chain A->B->C (tip):
parkblock(blockB) produces: A (no state change) -> B (parked, parked-parent) -> C (parked-parent)
Expected is: A (no state change) -> B (parked) -> C (parked-parent)
invalidateblock(blockB) produces: A (no state change) -> B (invalid, invalid-parent) -> C (invalid-parent)
Expected is: A (no state change) -> B (invalid) -> C (invalid-parent)
Test Plan: test_runner.py abc-parkedchain
Reviewers: deadalnix, schancel, Fabien, #bitcoin_abc
Reviewed By: deadalnix, Fabien, #bitcoin_abc
Subscribers: teamcity
Differential Revision: https://reviews.bitcoinabc.org/D1995