HomePhabricator

Fixed a bug where an invalidated or parked block would have child state applied…

Description

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

Details

Provenance
jasonbcoxAuthored on Nov 1 2018, 16:56
jasonbcoxPushed on Nov 2 2018, 22:12
Reviewer
Restricted Project
Differential Revision
D1995: 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.
Parents
rABCbc19d42d5a07: Use for-loop instead of list comprehension
Branches
Unknown
Tags
Unknown